Thread: 3d-movement
View Single Post
  #2  
Old 10-06-2008, 08:36 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
For the second "problem" I found a posible solution:

Code:
if key == 'z': #forward
	origin.setPosition(
		(origin.getPosition()[0]+(math.sin(vizmat.DEG_TO_RAD*origin.getEuler()[0])*0.1)),
		(origin.getPosition()[1]),
		(origin.getPosition()[2]+(math.cos(vizmat.DEG_TO_RAD*origin.getEuler()[0])*0.1))
	)
if key == 'b': #backwards
	origin.setPosition(
		(origin.getPosition()[0]-(math.sin(vizmat.DEG_TO_RAD*origin.getEuler()[0])*0.1)),
		(origin.getPosition()[1]),
		(origin.getPosition()[2]-(math.cos(vizmat.DEG_TO_RAD*origin.getEuler()[0])*0.1))
	)
and so on

Do you know a better way?
Reply With Quote