🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
3 messages
3 total messages Started by Peter Milne Mon, 04 Jan 1993 00:02
Getting Renderman examples involving RiLightSource to work?
#2013
Author: Peter Milne
Date: Mon, 04 Jan 1993 00:02
30 lines
1635 bytes
Following advice from other recent posters I managed to get the simple
Renderman example on page 18 of "The Renderman Companion" to work.
Unfortunately thought, I haven't been able to get the next example on
page 20 to work.  This example involves a RiLightSource call.
When I execute this example I get the following warning msg:

	Warning in context RMContext00001 in command RiLightSource :
	nullpointer: 'light' == 0

and nothing involving the specification of the lightsource gets written into
the .rib file.

Now I've tried it with and without the following RiOption

	RiOption(RI_ARCHIVE, "outputversion", &v31, RI_NULL);

The release notes for 3DKit say not to use this form of RiOption because
the version number doesn't get correctly written to the .rib file
and that instead you should use RiComment("\nversion 3.1");  Trouble is
RiComment doesn't seem to be in Media_s or NeXT_s and isn't commented
anywhere that I could find.

The release notes also say that this form of RiOption causes RiLightSource
to generate invalid sequence numbers and that it should be avoided.

Has anyone succeeded in getting the page 20 example to work?  Is so how
did you do it?

Cheers,
    Peter	(milne@csis.dit.csiro.au)
Re: Getting Renderman examples involving RiLightSource to work?
#2175
Author: J.Cassidy - Optometry
Date: Mon, 04 Jan 1993 15:19
20 lines
1327 bytes
In article <1993Jan4.000209.14805@csis.dit.csiro.au> pwm@csis.dit.csiro.au (Peter Milne) writes:
>Unfortunately thought, I haven't been able to get the next example on
>page 20 to work.  This example involves a RiLightSource call.
>When I execute this example I get the following warning msg:
>
>	Warning in context RMContext00001 in command RiLightSource :
>	nullpointer: 'light' == 0
>
>Cheers,
>    Peter	(milne@csis.dit.csiro.au)
>

I have been having precisely the same problem and would be
very interested in knowing if anyone has a solution!

=========================================================================
Jim Cassidy                           jcassidy@focus.uwaterloo.ca
University of Waterloo                optadm7@watserv1.uwaterloo.ca
200 University Ave.                   VE3RTS
Waterloo, Ontario, Canada N2L 3G1     (519) 885-1211 ext. 6240
Re: Getting Renderman examples involving RiLightSource to work?
#2228
Author: Joseph Goldstone
Date: Thu, 07 Jan 1993 13:05
68 lines
3064 bytes
Peter Milne writes
> Following advice from other recent posters I managed to get the simple
> Renderman example on page 18 of "The Renderman Companion" to work.
> Unfortunately thought, I haven't been able to get the next example on
> page 20 to work.  This example involves a RiLightSource call.
> When I execute this example I get the following warning msg:
> 
> 	Warning in context RMContext00001 in command RiLightSource :
> 	nullpointer: 'light' == 0
> 
> and nothing involving the specification of the lightsource gets written into
> the .rib file.
> 
> Now I've tried it with and without the following RiOption
> 
> 	RiOption(RI_ARCHIVE, "outputversion", &v31, RI_NULL);
> 
> The release notes for 3DKit say not to use this form of RiOption because
> the version number doesn't get correctly written to the .rib file
> and that instead you should use RiComment("\nversion 3.1");  Trouble is
> RiComment doesn't seem to be in Media_s or NeXT_s and isn't commented
> anywhere that I could find.
> 
> The release notes also say that this form of RiOption causes RiLightSource
> to generate invalid sequence numbers and that it should be avoided.
> 
> Has anyone succeeded in getting the page 20 example to work?  Is so how
> did you do it?
> 

RiLightSource underwent a sea-change post 3.1, to accomodate some interface  
changes involving handle scoping.

Try this:
#import <ri/ri.h>

RtPoint Square[4]={{.5,.5,.5}, {0.5,-.5,.5}, {-.5,-.5,.5}, {-.5,.5,.5}};

RtColor Color = {.2, .4, .6};
RtToken myDistantHandle;

int main(void)
{
  char *archive = "archive";
  char *ribfile = "pg20.rib";
  RiBegin(RI_NULL, "renderer", &archive, "filepath", &ribfile, RI_NULL);
    RiDisplay("pg20.tiff", RI_FILE, RI_RGBA, RI_NULL);
    myDistantHandle = RiCreateHandle("myDistantHandle", RI_LIGHTSOURCE);
    RiLightSource(myDistantHandle, "distantlight", RI_NULL);
    RiProjection("perspective", RI_NULL);
    RiTranslate(0.0,0.0,1.0);
    RiRotate(40.0,-1.0,1.0,0.0);
    RiWorldBegin();
      RiSurface("matte", RI_NULL);
      RiColor(Color);
      RiPolygon(4, RI_P, (RtPointer) Square, RI_NULL);
    RiWorldEnd();
  RiEnd();                                                               
  return 0;
}

If you like you can collapse the pedantic RiCreateHandle/RiLightSource couplet  
into:
  myDistantHandle = RiLightSource("myDistantHandle", "distantlight", RI_NULL);
which also works. This version is more or less what's documented on p.21 of the  
QRM beta release notes in Digital Librarian.

-- joseph
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads