View Single Post
Old 06-03-2013, 03:57 PM
kharms kharms is offline
Join Date: Jun 2013
Posts: 1
Urgent!! Rotation

due to our university project, we have to build an impossible world. Hereby it is possible to walk on the walls. You have to imagine it like that: Rigth in front of the wall is a Trigger (position and View) which rotates the world so that you find yourself standing on the wall where you just walked against.
I'll paste the method in here so you can have a look at it. What happens is that we fall outside the room after we spinned the world twice in a different direction. The problem with spin is also, that it turns off the collision so you fall through walls if you are next to them. Does anyone know another possibility to rotate the world so that the gravity also works? Or do I have to change the parameters in setcenter()?
It is very urgent and I am really desperate.
Thanks a lot !

def action(self,x,y,z,Node,deg = 90):
"""This function rotates the whole world when the user walks into a trigger. The user commits the axis where to rotate about and the amount of degrees.
On default it is set on 90 degrees, but can be changed.
x,y,z sets the axis where to rotate about. If you want to rotate about a certain axis, you have to change the value to 1, otherwise it is zero
Node is the WorldNode which is the parent of every object in the world. You add the action on this node.
deg sets the amount of degrees the world will be rotated."""

Node.setCenter(viz.MainView.getPosition(mode = ABS))

Reply With Quote