Sign in to follow this  

pleaseee help (texture mapping)

This topic is 3580 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 all... we are having a problm in our graduate project... in some phase in the project we needed to do meshing and triangulation for a person in a 2D image, wihch did succefully, thx God (now we have the vertices and triangles connecting them)... the next step is to prform texture mapping to our generated mesh... but after we set texture positions rendering the textured mesh... the output of texture mapping on my laptop wasn't properly drawn... although it's working properly at our supervisor's pc!! can anybody plz hlp us find a reason for this... I'm sending a link having the original img and the output of the texture mapping on my laptop... http://www.geocities.com/naroqueen/texture.html we are using DirectX 9.0 in our texture mapping

Share this post


Link to post
Share on other sites
Looks like the texture coordinates are screwed. The Debug Runtimes might give you a hint what's wrong.

A few questions:
1. What size is your texture? Is it a power-of-2 in width and height?
2. What are your UV coordinates like? Are you using a range of 0 to 1, or are you doing weird things like using the vertex coordinate for the UV coordinate?
3. How are you rendering the mesh? Are you filling a vertex buffer and using DrawPrimitive or DrawIndexedPrimitive, or are you using ID3DXMesh?

Share this post


Link to post
Share on other sites
Would you please clarify what do you mean by "texture coordinates are screwed"... and how can I feature this out using "Debug Runtimes"?

About the texture size, this texture specificly is not a power of 2 dimensions but I resized it to be power of 2 dimensions but unfortunately it didn't work too
Our UV coordinate is from 0 to 1 and we are rendering by filling a vertex buffer and using DrawPrimitive.

Thanks very much in advance :)

Share this post


Link to post
Share on other sites
It could be your texture size all most all video cards get messed up when you don't use 256x256, 512x512 etc also it looks like your faces only have 1 texture coordinate they need 3 one for each vertex.

Share this post


Link to post
Share on other sites
Quote:
Original post by naroqueen
Would you please clarify what do you mean by "texture coordinates are screwed"... and how can I feature this out using "Debug Runtimes"?
It looks like the texture is being roughly applied correctly, because the faces are all different shades. It just looks like you have all of the texture coordinates for the vertices set to that of one of them, which would give you one texel over the whole face.

If it works on your supervisors PC, but not on yours then it's probably a issue with the difference in video card or driver. The debug runtimes will point out any obvious mistakes. If it doesn't give you any relevant errors or warnings, the reference device (D3DDEVTYPE_REF instead of D3DDEVTYPE_HAL) should show you if it's a driver bug or if it's something wrong in your code.

And these two questions are still relevant:
2. What are your UV coordinates like? Are you using a range of 0 to 1, or are you doing weird things like using the vertex coordinate for the UV coordinate?
3. How are you rendering the mesh? Are you filling a vertex buffer and using DrawPrimitive or DrawIndexedPrimitive, or are you using ID3DXMesh?

Share this post


Link to post
Share on other sites
First of all, thanks for trying to help :) finally & Thanks God, somebody helped us solve the problem... the problem is that we are using TransformedTextured coordinates and we were not setting the 'W' component... that's all :)
thx again

Share this post


Link to post
Share on other sites

This topic is 3580 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this