Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load 3D models in OpenGL C++?

Tags:

c++

opengl

I am trying to load 3D models. How do I to read the data in the model file?

For an example, this is the data:

VERTICES
80 21 32
32 34 17
14 93 56
33 54 87
MODEL_SCALE 5

I know the data in 3D models is not like this, but how will I read the 'vertex data' and the 'model scale amount'?

like image 940
CppOgl Avatar asked Aug 14 '11 10:08

CppOgl


1 Answers

OpenGL doesn't do this for you. You should write your own parser, store the readed datas into your defined data structures and use OpenGL primitives to render them.

Here's a nice tutorial.

like image 54
Heisenbug Avatar answered Nov 15 '22 05:11

Heisenbug