WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   the difference between transform matrix and setEuler,setPosition,setScale (https://forum.worldviz.com/showthread.php?t=2904)

arscarsc 08-23-2010 07:41 PM

the difference between transform matrix and setEuler,setPosition,setScale
 
I don't understand what is the difference between transform matrix and setEuler,setPosition,setScale. In order to explain explicitly, we can use the following code as an exmaple

(1)import viz
viz.go()

logo = viz.add('logo.wrl')
logo.setPosition(0,0,10)
logo.setEuler([90,0,0])

(2)import viz
import vizmat
viz.go()
logo = viz.add('logo.wrl')
logo.setPosition(0,0,10)
x = vizmat.Transform()
x.makeAxisAngle(0,1,0,90)
logo.setMatrix(x)

farshizzo 08-24-2010 09:17 AM

The node.setMatrix command sets the entire transform matrix of the node, which includes position, rotation, and scale. The individual setPosition, setEuler, setScale, etc.. command only affect that specific attribute.

In your first example, the position of the object will be (0,0,10) after the call to setEuler.

In your second example, the position of the object will be (0,0,0) after the call to setMatrix, since you didn't specify a position value for the matrix.


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

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