Jump to content
  • Advertisement
Sign in to follow this  
Barrywei

Basic texture problem

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

Here is the code: in c# ------------------------------------------------ Mesh newmesh=null; Texture mytexture=null; public void Initialization() { ... //first built a mesh newmesh=Mesh.Box(device,10,10,10); ... //texture load from a file,I'm sure the filename and the path are correct mytexture=TextureLoader.FromFile(device, @"SEXTXT19.jpg"); device.setTexture(0,mytexture); ... //some code of material,light,world,view,projection matrxi set .. } public void Render() { ... device.BeginScene(); newmesh.DrawSubset(0); device.EndScene(); ... } -------------------------------------------------------- The problem is the result of the present box is not covered with the picture(SEXTXT19.jpg) i gave. The color of the box is always the picture's main color. If i use another picture,the color of the box is going to change as well. why?

Share this post


Link to post
Share on other sites
Advertisement
I'm not very familiar with managed Direct3D, but are you sure the mesh has texture coordinates assigned when it is created that way?

Share this post


Link to post
Share on other sites
I look up the mesh class in several books,none of them tell me how to texture on it.It seems that mesh.box(etc)just gives a model without texture coordinate,it's a easy way just for making a model.
eh~~~

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!