# 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.

## 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
CUSTOMVERTEX v[]=	{		{-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 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 on other sites
What vertex format you set? The one in second screenshot looks like D3DFVF_XYZRHW.

struct CUSTOMVERTEX{   float x, y, z; // vertex coords   float tx, yx; // texture coords};CUSTOMVERTEX v[] = {   {-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 heredevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, v, sizeof(CUSTOMVERTEX));

1. 1
2. 2
3. 3
Rutin
12
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633695
• Total Posts
3013382
×