WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Rotation (https://forum.worldviz.com/showthread.php?t=96)

Buster 12-11-2003 04:22 PM

Rotation
 
Hello Vizard Experts,

I am a beginner and need some help. Does anybody know a way (or the code) to allow the user's view to remain stationary (or at least the appearance of it) and to make a constellation of points in space rotate at the same time? We want to create an experiment where students watch a constellation of points while it is rotating so they can understand how all the points relate to each other on a 3-D level but we don't want them to move from their position. Is this possible?

Thanks in advance for your help!

Buster

farshizzo 12-11-2003 04:53 PM

Hi Buster,

If you attach an object to the HEAD then it will always be centered around the viewer. Let's say that your constellations are in a file called 'constellation.wrl', then you would simply do the following:

stars = viz.add('constellation.wrl',viz.HEAD)

Then when you rotate the model it will be rotating around the head, no matter where the viewer moves.

Are you importing the constellations from a model or generating them on-the-fly? If you're generating them on-the-fly then you would simply do something like the following:

viz.startlayer(viz.POINTS)
viz.vertex(...)
.
.
stars = viz.endlayer(viz.HEAD)

Look at the file spindots.py in the Vizard20/tutorial/onthefly. It is a simple example of creating a sphere of points and rotating them. Good luck!


All times are GMT -7. The time now is 01:12 AM.

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