WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   A compass in vizard (https://forum.worldviz.com/showthread.php?t=4982)

Qiliang He 03-13-2014 08:29 PM

A compass in vizard
 
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.


All times are GMT -7. The time now is 05:21 AM.

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