-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't render more than one mesh #11
Comments
Sorry to bring up an old thread, but I'm having the same issue regarding multiple meshes. Did you ever manage to fix it? |
nope. was stumped by this one and gave up learning OpenGL. if you crack it let me know the solution :) |
Wow how time flies... I randomly found this old project collecting dust on my hard drive today and remembered getting stuck all those years ago before I'd properly toyed with OpenGL. Facepalmed as soon as I had a look.. turns out the reason I was only seeing "one mesh" was because they both shared the same transform, so completely overlapped :) For anyone stumbling upon this years later, you'll want each mesh to have its own transform, then update the shader uniforms accordingly:
Ideally you'd make some sort of "entity" class or struct to make life easier:
quinn's issue may be something else, but at least for me it was just a case of "over-debugging" |
Hi there, your tutorial is excellent, thank you for putting so much work into this. My question is about the Mesh class, I am unable to get it to render multiple meshes. As far as I can tell this is due to the
m_vertexArrayObject
allocating the same ID for the mesh. Also, i had to make some changes to make this make more sense. For example, I changedm_vertexArrayObject
from aGLuint
to an array of length one:Secondly, the second argument to
glGenVertexArrays
is no longer passed as a pointer. Again, this is based on examples I found elsewhere. The problem I am facing is thatm_vertexArrayObject[SINGLE_VAO]
is always zero (i assume to that being the default value of the array), so (as far as i know) this means I can never have more than one mesh.Thanks for your help with this!
The text was updated successfully, but these errors were encountered: