OpenGL

Moderators: Sephiroth
Number of threads: 107
Number of posts: 202

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
problems with glVertexAttribPointer Posted by Cucus on 17 May 2011 at 7:49 AM
Hi,

I'm trying to render a robot which has 7 joints. Each joint is an object called "Joint". I load the vertices correctly but I don't know why I can just see the first joint. I new in openGL so I don't understand very well if my calls are correct or not and the reason why...

Here you can check my code:

vertexArray is the array where I put my vertexs points previously.

GLuint vertexs; 
glGenBuffers(1,&vertexs); 
glBindBuffer(GL_ARRAY_BUFFER,vertexs); 
glBufferData(GL_ARRAY_BUFFER,sizeVertex*sizeof(GLfloat),vertexArray,GL_DYNAMIC_DRAW); 
glEnableVertexAttribArray(0); 
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);




the render function:
void Joint::render()
{ 
glDrawArrays(GL_TRIANGLES,0,sizeVertex);
}


Can you see a problem? Thanks



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.