Thread: Object rotation
View Single Post
  #4  
Old 06-13-2007, 02:14 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The code I posted should work if the cylinder is oriented along its local z-axis. If the cylinder is oriented upward along its local y-axis, then you would need to perform another pre-rotation after the lookat.
Code:
object.translate(P1)
object.lookat(P2)
object.rotate(0,90,0,'',viz.RELATIVE_LOCAL)
Reply With Quote