![]() |
|
|
|
#1
|
|||
|
|||
|
Sorry, forgot to mention that you need to convert the matrix to the OpenGL reference frame:
Code:
m = viz.MainView.getMatrix().inverse() m[2] = -m[2]; m[6] = -m[6]; m[8] = -m[8]; m[9] = -m[9]; m[14] = -m[14]; |
|
#2
|
|||
|
|||
|
Thanks for that, farshizzo. One last question:
How would I tie everything together and add the model matrix to the equation? Do I have to perform any operations/conversions on this matrix as well? Also, what is the multiplication order of model, view, and projection matrices? <node3d>.getMatrix() on objects doesn't seem to work properly without either an inverse() or the same conversion you used for the view matrix. This seems really weird to me because I manually checked that the transformation matrix was correct as is. I'm simply trying to send the MVP to the shader, but everything seems to be flipped from what I'm used to. For example, P * V * M seems to be the wrong multiplication order. I also don't understand why you needed to do the conversion on the view matrix. Thanks again! |
|
#3
|
|||
|
|||
|
Yikes! I've been debugging for some time and it seems like there's still something wrong with the view matrix.
I made a simple plane and tried rendering it with: Code:
m = viz.MainView.getMatrix().inverse() m[2] = -m[2]; m[6] = -m[6]; m[8] = -m[8]; m[9] = -m[9]; m[14] = -m[14]; |
|
#4
|
|||
|
|||
|
Vizard will rotate certain model formats by 90 degrees along the X-axis in order to bring it into the Vizard coordinate frame. This is probably why you see a rotation.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vizard Headlight in Shader | shivanangel | Vizard | 1 | 06-27-2012 01:19 PM |
| SSAO Shader Implementation | FranciscoPeters | Vizard | 2 | 10-08-2011 04:19 AM |
| How to apply shader and render texture to an object | whj | Vizard | 0 | 04-23-2010 12:23 PM |
| Multiple Textures for Diffuse and Specularity Shader Issue | shivanangel | Vizard | 1 | 05-11-2009 10:44 AM |
| Specular Shader Issue | shivanangel | Vizard | 2 | 05-06-2009 11:08 AM |