View previous topic :: View next topic |
Author |
Message |
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Sat Feb 12, 2005 1:11 pm Post subject: Rendering .DMF |
|
|
I'm kinda using QUADS in opengl, but i think the UV cooridants are made for TRAINGLES?
Should render cubes in triiangles?
glBegin(GL_QUADS);
glTexCoord2f(box[i].uv_values0[1],box[i].uv_values1[1]);
glVertex3d(box[i].x4,box[i].y4,box[i].z4);
glTexCoord2f(box[i].uv_values2[1],box[i].uv_values3[1]);
glVertex3d(box[i].x5,box[i].y5,box[i].z5);
glTexCoord2f(box[i].uv_values4[1],box[i].uv_values5[1]);
glVertex3d(box[i].x6,box[i].y6,box[i].z6);
glTexCoord2f(box[i].uv_values6[1],box[i].uv_values7[1]);
glVertex3d(box[i].x7,box[i].y7,box[i].z7);
glEnd();
abit of the cdode
http://geocities.com/geforce2mx2000/engine/QUAD.jpg screenshot.. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Feb 12, 2005 1:48 pm Post subject: |
|
|
I am guessing you just have the wrong numbers inside your uv_values (or, more probably, have them in the wrong order). However, there is no way to see that from that code fragment. UV coordinates are not 'made' for anything. They are just per-vertex data. Both in DeleD and the OpenGL API.
This sounds like a very generic opengl beginners problem. Without wanting to do you wrong, do you have any prior OpenGL experience? You might want to try some simple examples (like those on http://nehe.gamedev.net) first.
If you are really (really really) stuck, you can always try sending me your source code and I'll see if I can find the time to fix it. What flavour of C++ are you in? |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Sat Feb 12, 2005 2:07 pm Post subject: |
|
|
vertices,materialID,vertice index values,uv values)
4;4;1;2;6;5;0.0000;-1.0000;-3.5000;-1.0000;-3.5000;3.5000;0.0000;3.5000;
1.2.6.5/....vertice index values..not sure what that is. |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Sat Feb 12, 2005 2:09 pm Post subject: |
|
|
Paul-Jan wrote: |
I am guessing you just have the wrong numbers inside your uv_values (or, more probably, have them in the wrong order). However, there is no way to see that from that code fragment. UV coordinates are not 'made' for anything. They are just per-vertex data. Both in DeleD and the OpenGL API.
This sounds like a very generic opengl beginners problem. Without wanting to do you wrong, do you have any prior OpenGL experience? You might want to try some simple examples (like those on http://nehe.gamedev.net) first.
If you are really (really really) stuck, you can always try sending me your source code and I'll see if I can find the time to fix it. What flavour of C++ are you in? |
c++ just know a little c++ and little opengl... |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Feb 12, 2005 3:34 pm Post subject: |
|
|
About "Vertex index values": first in the file is the vertex data (the x,y,z coordinates per vertex). If you'd store them into an array, those 'vertex index values' are the indices into that array. So 1, 2, 5 and 6 would be the vertices[1], vertices[2], vertices[5] and vertices[6]. |
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Sun Feb 13, 2005 9:55 am Post subject: |
|
|
Basically, you don't use GL_QUADS but GL_POLYGONS, because DeleD doesn't always use Triangles (or Quads) for it's format. You pass the Vertex data then with a loop to OpenGL. _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
|