#1
|
|||
|
|||
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]) so i figure that i can set the -pitch to rotate it opposite. Code:
compasslink.setEuler([-pitch,0,-yaw]) Last edited by brunomartelli; 07-22-2013 at 12:12 PM. Reason: clarity |
Tags |
compass, euler, view rotate |
|
|