WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-17-2009, 02:34 AM
lilio lilio is offline
Member
 
Join Date: May 2009
Posts: 11
Turn around the y-axis

Hello,

how can I turn my drawn layer around the y-axis?

Code:
viz.startlayer(viz.LINES)
viz.linewidth(3)
viz.vertexcolor(viz.RED)
viz.vertex(2,3,5)
viz.vertex(-1,2,9)
viz.startlayer(viz.POINTS)
viz.pointsize(10)
viz.vertex(2,3,5)
viz.vertex(-1,2,9)
vec1 = viz.endlayer()
And now I want to turn this line around the y-axis for an special amount.

I've tested this:

Code:
def keyboardAction(key):
	if viz.key.isDown('1'):
		vec1.addAction(vizact.spin(0,1,0, 10))

viz.callback(viz.KEYDOWN_EVENT,keyboardAction)
But that's not what I want.

I want to turn the line around the y-axis, but one point should be fixed. So only the second point of the line should turn around.

That it looks like one point is fixed and the other point of the line turns around the fixed point.

For example: I draw this line and if I push the key '1' then the second point turns about 10 degree around the y-axis.

Is this possible?
Reply With Quote
  #2  
Old 07-18-2009, 05:41 AM
lilio lilio is offline
Member
 
Join Date: May 2009
Posts: 11
I've solved my problem with this:

Code:
vec1.rotate(1,0,0,'',viz.RELATIVE_LOCAL)
This works fine, but I want to set the rotation point of my object at the first vertex.

So the first vertex should be fixed and the second one should rotate around this first one.

Currently my object rotates both vertex and the rotation point seems to be in the middle of the line.
Reply With Quote
  #3  
Old 07-20-2009, 09:44 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the <node>.center() command to set the pivot point for rotation. For example, if you wanted to rotate the line around the first vertex, you would use the following code:
Code:
vec1.center(2,3,5)
Reply With Quote
Reply


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
spin around axis object kazo11 Vizard 2 04-19-2007 09:48 AM
Object rotating around world axis, not own axis tacbob Vizard 1 02-15-2007 09:12 AM
executing a turn in the middle of a walkto action v-clizzin Vizard 1 09-18-2006 02:31 PM


All times are GMT -7. The time now is 10:56 PM.


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