home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / 18613 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.5 KB

  1. Path: sparky!uunet!olivea!sgigate!sgi!fido!mott
  2. From: mott@sgi.com (David Mott)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Inventor Question.
  5. Message-ID: <1ikm2aINNkb1@fido.asd.sgi.com>
  6. Date: 8 Jan 93 19:52:42 GMT
  7. References: <1993Jan7.204949.27213@erenj.com>
  8. Organization: Silicon Graphics
  9. Lines: 36
  10. NNTP-Posting-Host: clamato.asd.sgi.com
  11.  
  12. In article <1993Jan7.204949.27213@erenj.com> ram@ramsgi.erenj.com (ram rajagopalan) writes:
  13. >hi,
  14. >
  15. >  I would like to position a camera other than the default location, and 
  16. >  I haven't beeen quite successful at it.  Following is the piece of code
  17. >  I am using ...
  18. >
  19. >   root = SoSepCreate();
  20. >
  21. >   camera = SoPerspCamCreate();
  22. >   SoSV3fSetX_Y_Z(&camera->position,x_pos,y_pos,z_pos);
  23. >
  24. >   material = SoMtlCreate();
  25. >   SoSepRef( root );
  26. >   SoSepAddChild( root, (SoNode *) camera );
  27. >   SoSepAddChild( root, (SoNode *) SoDirLtCreate() );
  28. >
  29. >   ...
  30. >
  31. >
  32. >   If any one could point out the mistake in this code I would appreciate
  33. >   it.  Thanks in advance.
  34. >
  35.  
  36. This code seems fine. Are you calling SoPerspCamViewAll() on the camera?
  37. That would change the camera's position from whatever you set it to.
  38.  
  39. If not, does your data lie within the camera clipping planes? If you
  40. change the camera position, you may also have to change the camera
  41. nearDistance and farDistance fields so that your data does not get
  42. clipped out of view.
  43.  
  44. One of the example files that comes with Inventor sets the camera position.
  45. See /usr/src/Inventor/examples/PG1/11.2.AppEventHandler_c.c
  46.  
  47. David
  48.