Sign in to follow this  
td1

GLSL matViewProjection

Recommended Posts

Trying to implement a shader using opengl and GLSL. The shader requires matViewProjection, which I have no clue what it is or how to properly calculate it. Any assistance would be appreciated.

Share this post


Link to post
Share on other sites
You should read a couple if tutorials on this before trying to implement it. The [url="http://www.opengl.org/wiki/Tutorials"]OpenGL wiki[/url] has a couple of tutorials on how to get started with OpenGL 3.0.

Share this post


Link to post
Share on other sites
Without seeing the shader and judging by the name I'm guessing this is a 4x4 matrix that is equal to the ProjectionMatrix * the ModelViewMatrix

ModelView matrix can start out as the 4x4 identity matrix and from there it's not too hard to figure out how to translate/rotate the view.

ProjectionMatrix is going to be either Orthographic or Perspective most likely

The GLM math library has functions for these [url="http://glm.g-truc.net/api-0.9.2/a00163.html"]http://glm.g-truc.net/api-0.9.2/a00163.html[/url]

Share this post


Link to post
Share on other sites
[url="http://arcsynthesis.org/gltut/"]Learning Modern 3D Graphics Programming Through OpenGL[/url]
A nice tutorial for you.
Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this