WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Transform object & matrices (https://forum.worldviz.com/showthread.php?t=11)

david 03-24-2003 11:20 AM

Transform object & matrices
 
Hello everybody,

Is there any way to specify a transform object coefficient by coefficient? from what I have seen vizmat allows you to make only some special kinds of matrices. What if I want to reconstruct the perspective matrix that looks nothing like a rotation, translation or scaling?

David
(student at the MVL MIT)

farshizzo 03-24-2003 11:49 AM

Hi David,

I'm not exactly sure what you want to do, but you can manually set each individual element of the 4x4 matrix. The transform object has a function called 'set' which takes 16 numbers.

import vizmat

tran = vizmat.Transform()
tran.set(1,2,3, ... , 16)

Is this what you were looking for?

-- Farshid

david 03-24-2003 11:59 AM

thanks farshid

The method you mention is not in the vizard help (at least not the one I have), this is why I did not see it, but this is exactly what I was looking for.


David

farshizzo 03-24-2003 12:09 PM

Hi David,

I noticed a small bug in the vizmat library that will give you errors when trying to use the 'set' function. It will be fixed by the next release, but for now, here's how you can fix it:

Go to the main Vizard directory on your computer and open up 'vizmat.py'

Line 119 will be:

transform.set(self,self.id,f1,f2,f3,f4,f5,f6,f7,f8 ,f9,f10,f11,f12,f13,f14,f15,f16)

You should change it to:

transform.set(self.id,f1,f2,f3,f4,f5,f6,f7,f8,f9,f 10,f11,f12,f13,f14,f15,f16)

Save the file and restart Vizard.

Sorry about that.

-- Farshid

david 03-27-2003 09:18 AM

Thanks for the comment, this is going to spare me some real trouble


All times are GMT -7. The time now is 11:25 PM.

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