PDA

View Full Version : moving the head about


valhalla
09-21-2004, 11:42 AM
How would one move the head about in vizard independently of the body? For instance, I want to rotate the head about using angles without interfering with the body.

Thanks!

farshizzo
09-21-2004, 11:50 AM
Hi,

Take a look at the <viewpoint>.rotate command in the documentation. There is an optional paramter called mask which specifies whether to rotate the head or body orientation. By default it is set to the head orientation, so you shouldn't need to change anything. Here's an example anyway:view = viz.get(viz.MAIN_VIEWPOINT)
#Rotate the head orientation 90 degrees to the right
view.rotate(0,1,0,90)
#Rotate the body orientation 90 degrees to the left (which will rotate the head also, since it is attached to the body)
view.rotate(0,1,0,-90,viz.BODY_ORI)