View Single Post
  #1  
Old 05-21-2018, 08:48 PM
groot groot is offline
Registered User
 
Join Date: May 2018
Posts: 1
Rotation of MainView by a certain angle without use of on.keydown

I have tried vizact.spin and vizact.spinTo for this, but they only move to fixed angles relative to the original viewpoint.
eg. below is the least buggy code:
HTML Code:
turnRight = vizact.spinTo(euler=[90,0,0], speed=50)
turnLeft = vizact.spinTo(euler=[-90,0,0], speed=50)
	if "left" in command:
		viz.MainView.add(turnLeft)
	elif "right" in command:
		viz.MainView.add(turnRight)
However, if I am initially facing North, "left" would turn the MainView to West. After that, the command "right" would turn MainView to the East, instead of what we want, North.

Could someone advise me on what to do? Thanks!
Reply With Quote