WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-11-2008, 06:05 PM
roman_suvorov roman_suvorov is offline
Member
 
Join Date: May 2008
Location: Kingston, ON, Canada
Posts: 25
Damn, forgot about that acos. Then to get no rotation I need to use w=-1: 2*acos(-1) = 360 degrees. Thanks again farshizzo!

EDIT: The following code makes MainView look down X.
Code:
import viz
viz.go(viz.FULLSCREEN)

ROTATION_INC = 2
TRANSLATE_INC = 0.1

i = 0
while (i < 10):
	redBall = viz.add("white_ball.wrl")
	redBall.setPosition([i, 0, 0])
	redBall.color([1 - 0.1*i, 0, 0])
	
	greenBall = viz.add("white_ball.wrl")
	greenBall.setPosition([0, i, 0])
	greenBall.color([0, 1 - 0.1*i, 0])
	
	blueBall = viz.add("white_ball.wrl")
	blueBall.setPosition([0, 0, i])
	blueBall.color([0, 0, 1 - 0.1*i])
	
	i += 0.1
	
viz.MainView.setQuat([0,1,0,-1])
viz.MainView.setPosition(5, 0, 0.5)
	
vizact.whilekeydown(viz.KEY_UP, viz.move, 0, 0, TRANSLATE_INC)
vizact.whilekeydown(viz.KEY_DOWN, viz.move, 0, 0, -TRANSLATE_INC)
vizact.whilekeydown(viz.KEY_LEFT, viz.rotate, viz.BODY_ORI, -ROTATION_INC, 0, 0)
vizact.whilekeydown(viz.KEY_RIGHT, viz.rotate, viz.BODY_ORI, ROTATION_INC, 0, 0)
vizact.whilekeydown(viz.KEY_PAGE_UP, viz.rotate, viz.HEAD_ORI, 0, -ROTATION_INC, 0)
vizact.whilekeydown(viz.KEY_PAGE_DOWN, viz.rotate, viz.HEAD_ORI, 0, ROTATION_INC, 0)
and also produces much prettier axes. Hold on though, why [0,1,0]? We're speciifying no rotation around Y, not X as it seems?

Last edited by roman_suvorov; 06-11-2008 at 06:10 PM.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
coalesceing euler angles epl Vizard 6 05-28-2004 05:25 PM
plug-ins that return quaternions hotspur1 Vizard 2 02-05-2004 07:47 PM


All times are GMT -7. The time now is 06:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC