WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-21-2011, 10:05 AM
FreakyT FreakyT is offline
Member
 
Join Date: Apr 2011
Posts: 3
Question Translating relative to orientation with matrices

I'm working a script that builds a world and outputs a new VRML file. I'm just doing it in Vizard so I can take advantage of the easy-to-use matrix calculation. Or so I thought...

Anyway, I need to build a road out of components that are rotated, and then translated relative to their orientation. My code looks like this:

Code:
current_transform.preTrans(0, 120, 0)
current_transform.preEuler(current_area_curvature, 0, 0)
The idea is that I first rotate the object, and then push it forward in the correct direction. However, when I call

Code:
current_transform.getPosition()
I just get [0, 240, 0], [0, 360, 0], etc. Is there any way to move the object relative to its current orientation?
Reply With Quote
  #2  
Old 05-23-2011, 08:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Vizard uses the Z-axis for forward and Y-axis for up. Changing the code to the following should give you the behavior you are wanting:
Code:
current_transform.preTrans(0, 0, 120)
current_transform.preEuler(current_area_curvature, 0, 0)
Reply With Quote
  #3  
Old 05-23-2011, 07:16 PM
FreakyT FreakyT is offline
Member
 
Join Date: Apr 2011
Posts: 3
Quote:
Originally Posted by farshizzo View Post
Vizard uses the Z-axis for forward and Y-axis for up. Changing the code to the following should give you the behavior you are wanting:
Code:
current_transform.preTrans(0, 0, 120)
current_transform.preEuler(current_area_curvature, 0, 0)
Ah, that did the trick. Thanks!
Reply With Quote
Reply

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
problem in setting the orientation of bones bharatbhushan Vizard 0 06-30-2009 04:30 AM
Loading OSG models and orientation Joran Vizard 4 06-18-2009 05:43 AM
orientation question whj Vizard 3 01-21-2009 11:22 AM
(beginner) calculating orientation change with eulers astull Vizard 16 02-22-2007 09:45 AM
translating viewpoint along body orientation cade_mccall Vizard 3 08-29-2006 09:35 AM


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


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