WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-22-2013, 12:10 PM
brunomartelli brunomartelli is offline
Member
 
Join Date: Apr 2013
Location: London
Posts: 41
3dcompass

Hi im trying to make a 3d compass like a flat disc that sits on the ground and rotates in place.

so far i am doing this:

Code:
compass = viz.addChild('arrow.osgb')
compass.color( 0.2,0.8,0.8 )
###########################################
# get the main viewpoint and link a compass to it
view = viz.MainView

#link compass pos to viewpoint
compasslink = viz.link(view, compass)


pitch, roll, yaw = view.getEuler()


compasslink.setEuler([0,0,-yaw])

#offset compass origion before linking to view
compasslink.preTrans([0, -0.5, 0])
this rotates fine, opposite to the view rotate. However if I pitch up the view LMB+RMB the compass doesn't rotate up with the view.
so i figure that i can set the -pitch to rotate it opposite.

Code:
compasslink.setEuler([-pitch,0,-yaw])
However That does nothing. I know there is HEAD_ori etc but that does nothing too. Any ideas???? im really stuck....

Last edited by brunomartelli; 07-22-2013 at 12:12 PM. Reason: clarity
Reply With Quote
 

Tags
compass, euler, view rotate

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:50 PM.


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