danielepanozzo / cg-old

44 stars 16 forks source link

about texture mapping #116

Closed peiyueY closed 5 years ago

peiyueY commented 5 years ago

Hi, I try to apply texture mapping for my object, but the object is completely black. I look up some tutorials and the only difference is that I use glDrawArrays instead of glDrawElements. To apply texture mapping, are we supposed to use glDrawElements to draw objects?

Since I use V rather than vertices[] and indices[] to store vertices, I don't know how to use glDrawElements based on my current code.

Thanks, Peiyue

danielepanozzo commented 5 years ago

It is unlickely that the problem is the use of glDrawArrays, texture mapping can be used with both of these OpenGL commands. I recommend to start from a working tutorial, and then change it for your needs.