WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Changing the viewpoint angle (https://forum.worldviz.com/showthread.php?t=82)

jaytee 11-02-2003 08:02 PM

Changing the viewpoint angle
 
The world I'm creating needs to use the arrow keys to control the view. I am starting with the arrow key control from the gallery example:

Code:

#Go Forward or Backward
if viz.iskeydown(viz.KEY_UP):
  viz.move(0,0,TRANSLATE_INC)
elif viz.iskeydown(viz.KEY_DOWN):
  viz.move(0,0,-TRANSLATE_INC)
                       
#Turn Left or Right
if viz.iskeydown(viz.KEY_LEFT):
  viz.rotate(viz.BODY_ORI,-ROTATION_INC,0,0)
elif viz.iskeydown(viz.KEY_RIGHT):
  viz.rotate(viz.BODY_ORI,ROTATION_INC,0,0)

How would I modify this so that the up and down arrows instead control the view pitch? (not sure if that's the correct terminology... I want to change how high or low the user is looking).

Thanks so much for your help... sorry for all these newbie questions.

farshizzo 11-03-2003 10:34 AM

the 3 arguments to the viz.rotate command is yaw, pitch, and roll. So just make ROTATION_INC the second argument instead of the first.
Code:

#Turn Up or Down
if viz.iskeydown(viz.KEY_UP):
  viz.rotate(viz.BODY_ORI,0,-ROTATION_INC,0)
elif viz.iskeydown(viz.KEY_DOWN):
  viz.rotate(viz.BODY_ORI,0,ROTATION_INC,0)



All times are GMT -7. The time now is 06:36 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC