Jump to content
  • Advertisement
Sign in to follow this  
saeed_sp

how assign bitmap to 3d model in .net

This topic is 3624 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

hi. i want to load a model that had built in 3 studio max and then assign it a bitmap in .net. pleas help me.

Share this post


Link to post
Share on other sites
Advertisement
I'm afraid you're going to have to be a little more specific than that.

.Net is an environment that encompasses lots of languages, which one are you using? With DirectX, XNA, OpenGL? Do you have any experience, whats your skill level?

Share this post


Link to post
Share on other sites
You'll want to make a couple of variables...


Quote:

private Texture texture;
private Material material;


then in populate them like this:

Quote:

private void LoadTexturesAndMaterials()
{
material = new Material();

material.Diffuse = Color.White;
material.Specular = Color.LightGray;
material.SpecularSharpness = 15.0F;

device.Material = material;

texture = TextureLoader.FromFile(device, "mymeshtexture.bmp");
}


then just before you draw your mesh set the texture to the device like so...

Quote:

device.SetTexture(0,texture);


that should do it.

Andy

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!