open a 3dmodel in opengl

E7a408293454588084c3f3d5ee57925a
0
nexusssz 101 Aug 23, 2006 at 16:40

Hi guys
i’ve a problem here…hope u can help..
i’ve the following data extracted from a 3d model.
how do i display the model in opengl???

Vertex 1 -0.00423 0.78933 4.45589 {normal=(-0.00266 0.267 0.966)}
Vertex 2 -0.4276 1.862 3.8984 {normal=(-0.01221 0.4969 0.8681)}
Vertex 3 -0.81184 2.1162 3.12242 {normal=(-0.0444 0.6719 0.74012)}
Vertex 4 -1.13479 3.3543 2.4625 {normal=(-0.09215 0.7945 0.60084)}
Face 1 - vertex 1 vertex 7 and vertex 2
Face 2 - vertex 2 vertex 8 and vertex 3
Face 3 - vertex 3 vertex 9 and vertex 4

nex

6 Replies

Please log in or register to post a reply.

6bb044a6169e66216a8ca1b273eee992
0
Grolsch 101 Aug 23, 2006 at 22:33

What model format is this?
Have you tried to google for code that loads and renders that model format?

E7a408293454588084c3f3d5ee57925a
0
nexusssz 101 Aug 24, 2006 at 01:42

hi Grolsch,
yup, tried to get sample codes from the net…but cant seems to find it. the extension of the file is .m

looking for ways to load the model using GL. Hope anyone here can help.. Thanks heap.

nex

6bb044a6169e66216a8ca1b273eee992
0
Grolsch 101 Aug 24, 2006 at 01:56

Didn’t find the .m file format on wotsit.org. What program did you use to make the model? Or where did you find it?

E7a408293454588084c3f3d5ee57925a
0
nexusssz 101 Aug 24, 2006 at 02:25

can i email it to u…?

6bb044a6169e66216a8ca1b273eee992
0
Grolsch 101 Aug 24, 2006 at 10:33

I would not be able to get much use out of it. Why don’t you pick a more common 3D format?

1a4a09cc4ae6e16b27814feee8bef3ff
0
publicENEMY 101 Aug 24, 2006 at 13:41

easy.

first, you must parse the 3d data file and allocate the geometric informations into arrays(or struct, whatever suits your needs).

second, read data from the array and render it as usual.

actually, i see no problem here.

most likely, this is an assignment and you a just a beginning student. dont bother searching the net for loader, as this is custom made for your class. nobody even bother to make loader to this kind of data(ASCII, too many unnecessary words). there are other tips for optimization, but ill leave it for later, if you prove you can do the simple way.