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.
vex syntax matrix4*4
4258 3 0- labuzz
- Member
- 82 posts
- Joined: Oct. 2007
- Offline
- Mario Marengo
- 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.
- labuzz
- Member
- 82 posts
- Joined: Oct. 2007
- Offline
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
-
- Quick Links