PDA

View Full Version : A compass in vizard


Qiliang He
03-13-2014, 08:29 PM
I want to create a compass like pointer staying in the upper-left corner and always pointing to the north. I set the orientation of the pointer using Compass.setEuler([0,0,0]). It works fine, but then when I make the compass to stand upright using Compass.setEuler([0,90,0]), the compass just doesn't point to other orientations. What is wrong and how can I solve this?

This is my first time I ask question in the worldviz community, forgive me if I'm not addressing the question properly.

Frank Verberne
03-14-2014, 05:40 AM
First of all: welcome to the forum:)!

Could you explain your problem in more detail? For instance, is the compass 2D or 3D? Do you want to animate the compass so that when you move the mainview, the compass points to the north relative to the current orientation? If so, you need to update the orientation of the compass all the time, based on the current orientation. If you can explain what you are trying to accomplish more clearly, we can help you better.

It would also be helpful if you could post some sample code that everyone can run without any extra models, so you could replace the compass model that you use with the arrow.wrl model that is included in the Vizard installation. Also wrap your code in code tags (select the text in your post that is code and click the hashdeck sign). It will make your code much more readable for all of us.