Archived

This topic is now archived and is closed to further replies.

BlueChip

Problem: Texture Coordinate with a VB [3 screenshot]

Recommended Posts

sorry .. sorry ...sorry

quote:

Are you sure you don''t want?


yes, I use

pVertex->tu = (float)z/numVertInZ;
pVertex->tv = (float)x/numVertInX;


quote:

Just checking, your not applying any matrices as well are you?


and yes I apply a matrix in Render() method....
is this that you mean... true?

quote:

but what are the Y values of your verticies



I''ve copied only a piece of my code..what I thought useful ...
Maybe is better if I post all my code?

thanks for your help guys =)


Share this post


Link to post
Share on other sites
quote:
Original post by BlueChip
quote:

Just checking, your not applying any matrices as well are you?


and yes I apply a matrix in Render() method....
is this that you mean... true?

I''ve copied only a piece of my code..what I thought useful ...
Maybe is better if I post all my code?



yeah, better post more of your code so we can see if things like your D3DFVF_CUSTOMVERTEX are defined properly.


quote:
Original post by BlueChip
quote:

Just checking, your not applying any matrices as well are you?


and yes I apply a matrix in Render() method....
is this that you mean... true?



No, I think he is referring to texture matricies, not world transformation matricies.

Share this post


Link to post
Share on other sites
hello

quote:

yeah, better post more of your code so we can see if things like your D3DFVF_CUSTOMVERTEX are defined properly.



ok ... is here =)
quote:

No, I think he is referring to texture matricies, not world transformation matricies.


.. no I don't thing that I've made it.... because I don't know it ...
I've searched in SDK and I've found some informations, but I don't know if it is that de_matt say..

is this?

m_pd3dDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX , D3DTSS_TCI_PASSTHRU );


byez =)


[edited by - BlueChip on November 18, 2003 11:37:19 AM]

Share this post


Link to post
Share on other sites
change

struct CUSTOMVERTEX
{
float x, y, z;
float tu, tv; // The texture coordinates.
D3DVECTOR normal;
};

// Custom FVF, which describes the custom vertex structure.
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_NORMAL)


to this


struct CUSTOMVERTEX
{
float x, y, z;
D3DVECTOR normal;
float tu, tv; // The texture coordinates.
};

// Custom FVF, which describes the custom vertex structure.
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_NORMAL)


WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
yep... now it works.. woow thanks ..

I believed that order in FVF was dependent by vertices structure declaration..
But if this isn't true, then how I can know the right order?

thanks again =)

[edited by - BlueChip on November 18, 2003 4:09:55 PM]

Share this post


Link to post
Share on other sites
The #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_NORMAL) is basically a bitwise combine (and) based on those constant DWORDS. It does not matter what is defined first, because the result will always be the same regardless of how you define it.

In the SDK, it explains the possible structure for a FVF format. You must use it in that order defined in the SDK. To see what I''m referring to, look at: DirectX Graphics/Programming Guide/Getting Started/Vertex Formats. Of course you can remove most of what is in that FVF, but it must be constructed in the order, and the correct flags specified (the #define in question)

Share this post


Link to post
Share on other sites