Rotate Viewpoint 360 Around Point/Object
I am looking at a vizshape.addBox in my Vizard environment and would like to smoothly rotate the viewpoint 360 degrees around this point to show the user all sides. I am not that familiar with 3D rotations, but I believe I only want to change the yaw for this to happen correctly. I have tried all sorts of different spin, goto, and setEuler combinations but nothing works as I would like.
I can get the position of the object with the getPosition function, so I am hoping to use a combination of this position and another function to solve this problem. Any assistance would be greatly appreciated. Also, please feel free to ask for more information. Chris |
I found this example on the worldviz website:
http://docs.worldviz.com/vizard/exam...iewAnimate.htm It is very similar to what I am looking for, but is there a way to make the transition between pressing 1-4 smooth, i.e. the center of the pivot object is the axis and the user is making a smooth 360 degree rotation around the center leaving a small radius of space between the camera and the object as the rotation happens? Also, I keep running into quaternion rotation when I google this topic, but I do not see any examples of setQuad on the Viz website. Is there a good reference to learning what this function can do? Thanks, Chris |
Here is an example that shows one way of accomplishing this. I created a simple function LookAtBox that places the viewpoint at a specific distance and yaw from the box. I then use a task function to continually call the function for a 360 degree spin.
Code:
import viz |
Works perfectly! Thanks again for the help.
|
All times are GMT -7. The time now is 12:48 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC