Jump to content
  • Advertisement
Sign in to follow this  
cherryhouse

OpenGL Textures

This topic is 4556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a land and dinosaur model with milkshape3d, put a few textures on it but nothing shows up. Dino demo This is my first demo I am trying to complete without looking at any tutorials(or not many) but this texture problem i ran into isn't something I covered. Is there a milkshape3d loader that would allow me to load the texture aswell as the model while keeping it the same difficulty level(or a little bit harder) as the plain loader nehe's tutorial uses? PS. Feedback on the demo would be cool, just remember i only started programming with opengl about 4 days ago. If you run the demo, the only two keys i implemented were to test out and fix the prespective. Left arrow key to turn left, right arrow key for right.

Share this post


Link to post
Share on other sites
Advertisement
Uh, not really sure what you mean, but you'll have to implement a loader for textures at some time, so you might as well write it now. I doubt that there is a combined milkshape-texture loader.

What "plain loader" are you talking about? I know that nehe have a tga loader. Not so sure about a bitmap loader, but it shouldn't be too hard to find.

Share this post


Link to post
Share on other sites
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=31 This allows the model to load one texture, I Don't know wether i need to create a full body texture in a bitmap file meaning the head/body/legs/arms..etc are all on the same bmp or would i be able to load the textures using the milkshape 3d materials. When applying model textures to an object in milkshape, the textures get "binded" to the ms3d file so to speak. I am asking is there a way to load the model with the "binded" textures still appearing on the model.

Share this post


Link to post
Share on other sites

/**
* Material for a milkshape model.
*/

struct ms3dmaterial{
char name[32]; ///< Name of the material
float ambient[4]; ///< 4 components for the ambient material component (RGBA)
float diffuse[4]; ///< 4 components for the diffuse material component (RGBA)
float specular[4]; ///< 4 components for the specular material component (RGBA)
float emissive[4]; ///< 4 components for the emissive material component (RGBA)
float shininess; ///< Shininess factor - from 0.0f to 128.0f
float transparency; ///< Transparency factor - from 0.0f to 1.0f
char mode; ///< unused
char texture[128]; ///< texture filename (bitmap)
char alphamap[128]; ///< alphamap filename (bitmap)
};



Yes. You load the texture name at the same time as when you load the materials.

I'm sure you know this already, but milkshape models are generally split up into "groups". So, you have a bunch of triangles here, and they represent the head, another bunch here, which is the torso.

Each should have a material associated with it. The name of the texture for each group is in the material.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!