Thanks !!

Now i at least got the triangle on the screen. I have checked the examples 
where they have used addUniform and it works fine . Check osgparametric. Any 
more explanation ?

And the matirx that i am sending as uniform has no effect at all.  I should see 
a triangle rotated to a certain angle.

The application has the following addition as follows:


Code:

  //declare a rotation matrix
  osg::Matrix rotationMatrix;
  float angle = osg::inDegrees((float)80);
  rotationMatrix.rotate(angle,osg::Vec3(0.0f,0.0f,1.0f));

......................
......................

primitiveState->getOrCreateUniform("RotationMatrix",osg::Uniform::FLOAT_MAT4)->set(rotationMatrix);



 


And the shader are as follows:

Vertex Shader

Code:

#version 400

in vec3 VertexPosition;
in vec3 VertexColor;

out vec3 Color;

uniform mat4 RotationMatrix;

void main()
{
    Color = VertexColor;

    gl_Position = RotationMatrix * vec4(VertexPosition,1.0);

}





And the fragment shader


Code:

#version 400

in vec3 Color;
out vec4 FragColor;

void main() {
    FragColor = vec4(Color, 1.0);
}





It will be nice if you try this at your end and recreate the behavior i am 
having here. 

Thanks
Sajjadul

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56636#56636





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to