Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by J. G. Gregory
Sat, 26 Sep 1992 16:28
Help with N3DCamera orientation
Author: J. G. Gregory
Date: Sat, 26 Sep 1992 16:28
Date: Sat, 26 Sep 1992 16:28
63 lines
2436 bytes
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
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