vex syntax matrix4*4

   4260   3   0
User Avatar
Member
82 posts
Joined: Oct. 2007
Offline
Hello,
I would like to know if this syntax is correct ( I am getting an error ):
$e and $d are floats. It looks like matrix() is taking a string pattern…I have try to concatenate without success.

matrix $persProj = { {$e, 0, 0, 0}, {0, $d, 0, 0}, {0, 0, $d, -1}, {0, 0, 0, 0} };

tky.
User Avatar
Member
941 posts
Joined: July 2005
Offline
labuzz
Hello,
I would like to know if this syntax is correct ( I am getting an error ):
$e and $d are floats. It looks like matrix() is taking a string pattern…I have try to concatenate without success.

matrix $persProj = { {$e, 0, 0, 0}, {0, $d, 0, 0}, {0, 0, $d, -1}, {0, 0, 0, 0} };

tky.

A 4x4 matrix is an array of 16 floats, not an array of 4 vector4's. Also, the {a,b,c,d} syntax is for constant, literal values, not variables. So {1,2,3,4} is OK (as a vector4 constant), but {e,0,0,0} isn't. I assume that the ‘$’ signs are there because this is being written in an Inline VOP? (else they shouldn't be there).

So, in your example, persProj should be initialized like this:
matrix $persProj = set($e,0,0,0, 0,$d,0,0, 0,0,$d,-1, 0,0,0,0);

Hope that makes sense.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
82 posts
Joined: Oct. 2007
Offline
yep its in an inline vop.
Tks a lot Mario.
Hopefully one day you will write a book on mantra ( I have a mario folder in my firefox/scrapbook/houdini folder )!

Cheers.
User Avatar
Member
941 posts
Joined: July 2005
Offline
labuzz
yep its in an inline vop.
Tks a lot Mario.
Hopefully one day you will write a book on mantra ( I have a mario folder in my firefox/scrapbook/houdini folder )!
Thanks. I'm glad it helped.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
  • Quick Links