🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1617

Help with N3DCamera orientation

#1617
From: J. G. Gregory
Date: Sat, 26 Sep 1992 16:28
63 lines
2436 bytes
I have some questions about specifying the orientation of N3DCamera.  Any help  
would be greatly appreciated.

Question 1:

How do I reliably set the roll angle of an N3DCamera?

I have been unable to get an isometric view without kludges.  I'm trying to use  
this simple method:

- isoView
{
   RtPoint eye = {1,-1,1}; // Really scaled for size of world
   RtPoint view = {0,0,0};

   [self setEyeAt:eye toward:view roll:0];
 
   return self;
}

This aligns the T axis (camera vertical) with the world's Y axis.  I need it  
aligned with the world's Z axis. 

If you think about it, the whole concept of setEyeAt:toward:roll: is broken.   
How can it know what orientation the Camera starts at?  You have to have some  
kind of start orientation for any kind of angle to make sense.  I would be  
surprised if any can use it effectively.  But maybe I am missing something.

Question 2:

How do I set up a right-handed coordinate system?  I have written about this  
before, but still haven't got it right.  What I really want to do is set up a  
right-handed system BEFORE either the camera or world transforms are set, such  
that everything is right-handed.  But 3Dkit doesn't let you do the same things  
as general RenderMan procedural calls, since you can't seem to get in before  
the camera is up.

I have tried lots of different approaches.  The code below yields the correct  
orientation of the axes, but gives the following message in the Console  
whenever something is rendered, or whenever I ask for selectedShapesIn:.

Warning in context 708DF in command ?:  OutOfRange:
        Anisometric world-to-camera transformation.
Shading may be incorrect.

Code from [MyCamera initFrame:]

  RtMatrix orient = {{-1, 0, 0, 0},
		     { 0, 1, 0, 0},
		     { 0, 0, 1, 0},
		     { 0, 0, 0, 1}};

  [super initFrame:theRect];
  [self setPreTransformMatrix:orient];
  [self setUsePreTransformMatrix:YES];

and code from [MyCamera worldBegin:]

   RiScale(1.0, 1.0, -1.0);
   return [super worldBegin:theContext];

Thanks in advance, 
--J Gregory
Technical Details
Message-ID: <1992Sep26.162803.717@proforma.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!proforma!jgg

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!proforma!jgg
From: jgg@proforma.com (J. G. Gregory)
Subject: Help with N3DCamera orientation
Message-ID: <1992Sep26.162803.717@proforma.com>
Keywords: 3Dkit
Sender: jgg@proforma.com
Organization: Pro Forma
Date: Sat, 26 Sep 1992 16:28:03 GMT
Lines: 63