@PleekMan wrote:
Hello everyone!!
This is my first post, concerning shaders…!!After studying linear algebra, I am trying to understand how the matrix operations are implemented in the shaders’ “gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex” line of code, so that I know where I’m standing in terms of vertex values/positions, and what freedoms do I have if I start playing with each one of them separately
My understanding, so far:
gl_Vertex:
Absolute position of vertex in 3d Space??
If there’s an ofBox, for example, will gl_Vertex for the 6 vertices be relative to the box, or still to the world.gl_ModelViewMatrix:
The name throws me off a little bit.
Is this the vertex in cameraSpace?So that if:
gl_Vertex.x = 100
cam.x = -100
then the vertex final position.x = 200 (aprox).gl_ProjectionMatrix
Camera-wise vanishing-point (or orthogonal) deformation.
In the shader, When I try: gl_ProjectionMatrix + vec4(0, 0, zValue, 0), it quickly goes off screen or off clipping. Maybe playing around at these stage of operations is just weird!! jaja!I appreciate your help…!!
Please, let me know if I should clarify or rePhrase something.
Posts: 3
Participants: 2