home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!sgi!fido!mott
- From: mott@sgi.com (David Mott)
- Newsgroups: comp.sys.sgi
- Subject: Re: Inventor Question.
- Message-ID: <1ikm2aINNkb1@fido.asd.sgi.com>
- Date: 8 Jan 93 19:52:42 GMT
- References: <1993Jan7.204949.27213@erenj.com>
- Organization: Silicon Graphics
- Lines: 36
- NNTP-Posting-Host: clamato.asd.sgi.com
-
- In article <1993Jan7.204949.27213@erenj.com> ram@ramsgi.erenj.com (ram rajagopalan) writes:
- >hi,
- >
- > I would like to position a camera other than the default location, and
- > I haven't beeen quite successful at it. Following is the piece of code
- > I am using ...
- >
- > root = SoSepCreate();
- >
- > camera = SoPerspCamCreate();
- > SoSV3fSetX_Y_Z(&camera->position,x_pos,y_pos,z_pos);
- >
- > material = SoMtlCreate();
- > SoSepRef( root );
- > SoSepAddChild( root, (SoNode *) camera );
- > SoSepAddChild( root, (SoNode *) SoDirLtCreate() );
- >
- > ...
- >
- >
- > If any one could point out the mistake in this code I would appreciate
- > it. Thanks in advance.
- >
-
- This code seems fine. Are you calling SoPerspCamViewAll() on the camera?
- That would change the camera's position from whatever you set it to.
-
- If not, does your data lie within the camera clipping planes? If you
- change the camera position, you may also have to change the camera
- nearDistance and farDistance fields so that your data does not get
- clipped out of view.
-
- One of the example files that comes with Inventor sets the camera position.
- See /usr/src/Inventor/examples/PG1/11.2.AppEventHandler_c.c
-
- David
-