Hello.

My task is to render an animated dae character with shaders.
I have created a simple vertex shader:

attribute vec4 position_attribute;
attribute vec4 color_attribute;

varying vec4 color;

void main(){
color = color_attribute;
gl_Position = gl_ModelViewProjectionMatrix * position_attribute;
}
After that i use stateset->setAttributeAndModes to assign the program to
the model .
I assign the position and color atrtibute to the corresponding location
according to this:

gl_Vertex 0
gl_Normal 2
gl_Color 3
gl_SecondaryColor 4
Everything works fine.



The problem comes when i try to pass manually the vertex array and color
array using:
geom->setVertexAttribArray(attrib_num, data_array);
geom->setVertexAttribBinding(attrib_num, attrib_binding);
I pass the RigGeometry's VertexArray as data array, but the character is
not animated because the default
geometry's values are passed. Watching the osganimationhardware example i
noticed that i have to pass the bone matrices
as well and multiply with vertex position.


Is there any Array which keeps the updated vertex positions according to
the animation?
If there is, i can match this array's values to position attribute, without
having to pass the matrices in the shader.

Thank you for your time and sorry for the long post.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to