Original Post
How do I load 3ds models in C++ and OpenGL?
Quote:
Original post by Stompy9999
By the way, I'm using Anim8or as my model editor, so if anyone knows how to load from that, that would be good too.
float* maxX; float* maxY; float* minX; float* minY; float* lengthX; float* lengthY; //--------------- TRI_VERTEXL --------------- // Description: Vertices list // Chunk ID: 4110 (hex) // Chunk Lenght: 1 x unsigned short (number of vertices) // + 3 x float (vertex coordinates) x (number of vertices) // + sub chunks //------------------------------------------- case 0x4110: fread (&l_qty, sizeof (unsigned short), 1, l_file); p_object->vertices_qty = l_qty; printf("Number of vertices: %d\n",l_qty); for (i=0; i<l_qty; i++) { fread (&p_object->vertex.x, sizeof(float), 1, l_file); printf("Vertices list x: %f\n",p_object->vertex.x); fread (&p_object->vertex.y, sizeof(float), 1, l_file); printf("Vertices list y: %f\n",p_object->vertex.y); fread (&p_object->vertex.z, sizeof(float), 1, l_file); printf("Vertices list z: %f\n",p_object->vertex.z); if (&p_object->vertex.x > maxX) { maxX = &p_object->vertex.x; } if (&p_object->vertex.y > maxY) { maxY = &p_object->vertex.y; } if (&p_object->vertex.x < minX) { minX = &p_object->vertex.x; } if (&p_object->vertex.y < minY) { minY = &p_object->vertex.y; } } printf("Max X: %f\n", maxX); printf("Max Y: %f\n", maxY); printf("Min X: %f\n", minX); printf("Max Y: %f\n", minY); break;
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more