WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-14-2008, 09:49 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The VRML rotation field is an axis-angle rotation. To convert a Vizard axis-angle rotation to a VRML axix-angle rotation, you will need to negate the x,y components of the axis vector and convert the degrees to radians. Here is a function that will return the VRML rotation of a cone given the bottom and top points of the cone:
Code:
def getVRMLConeRotation(bottom,top):
	
	v = viz.Vector(top)
	v -= bottom
	
	m = viz.Matrix()
	m.makeVecRotVec([0,1,0],v)
	
	r = m.getAxisAngle()
	
	return -r[0],-r[1],r[2],viz.radians(r[3])
Reply With Quote
 


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
saving the scene giancamati Vizard 1 12-21-2006 09:25 AM
saving the position poolshark Vizard 3 09-26-2003 01:57 PM


All times are GMT -7. The time now is 07:07 AM.


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