If you want the compass to rotate with the viewpoint you can create a link and set the mask to orientation only. If you want the compass yaw to be the opposite of the viewpoint use the
link.swapEuler command:
Code:
import viz
import vizshape
viz.go()
viz.add('dojo.osgb')
compass = vizshape.addArrow()
compass.setPosition([0,0.5,0])
compassLink = viz.link(viz.MainView,compass,mask=viz.LINK_ORI)
#Negate yaw value
#compassLink.swapEuler([-1,2,3])
subWindow = viz.addWindow(pos=[0.5,1])
subWindow.setSize(0.5,0.5)
view = viz.addView()
view.move([0,-1,-4])
subWindow.setView(view)