Jump to content
  • Advertisement
Sign in to follow this  

Need Help wiith setting co-ordinates for texture

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

Hey guys.I am not really strong with 3d cartesian geometry et al.I've been trying to get an out put like this

but i end up with this instead

I am not very good with setting them vertex normals too.

these are my texture co-ordinates

{-20.0f, -2.5f, -20.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, },
{-20.0f, -2.5f, 20.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,},
{ 20.0f, -2.5f, 20.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f,},
{-20.0f, -2.5f, -20.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f,},
{ 20.0f, -2.5f, 20.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f,},
{ 20.0f, -2.5f, -20.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f,},


my CUSTOMVERTEX format is (x, y, z, nx, ny, nz, texel u, texel v)

EDIT:sorry if this question is too dumb.i am a noob..

[Edited by - tariq9112003 on August 21, 2010 5:19:33 AM]

Share this post

Link to post
Share on other sites
From the pictures, it appears that you're drawing the quads with the light colored texture in a vertical plane, rather than a horizontal plane. That doesn't have anything to do with your texture coordinates.

You need to either rotate the quads mesh or change the coordinates.

Share this post

Link to post
Share on other sites
What vertex format you set? The one in second screenshot looks like D3DFVF_XYZRHW.

float x, y, z; // vertex coords
float tx, yx; // texture coords

{-20, -2.5f, -20, 0, 0}
{ 20, -2.5f, -20, 1, 0}
{-20, -2.5f, 20, 0, 1}
{ 20, -2.5f, 20, 1, 1}};

device->SetFVF(D3DFVF_XYZ | D3DFVF_TEX1); // D3DFVF_XYZ means it's vertex in 3D world, D3DFVF_TEX1 tells you have texture coords
//set texture here
device->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, v, sizeof(CUSTOMVERTEX));

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!