Texture-matrix 
Author Message
 Texture-matrix

How could I calculate an matrix to scale/rotate/translate an texture on my
geometry?


Tue, 19 Apr 2005 23:23:44 GMT  
 Texture-matrix
search for D3DTS_TEXTURE in the samples on the C++ side for an example
usage, and then translate to VB.

I see that the Moire Screensaver sample as well as BumpWaves and BumpLens
make use of texture transforms. Also Tutorial 5.
--
Phil Taylor


Quote:
> How could I calculate an matrix to scale/rotate/translate an texture on my
> geometry?



Wed, 20 Apr 2005 00:44:47 GMT  
 Texture-matrix
In the DX8 SDK there is already an sample about texture-animation (the
animation is commented out)

Ok, here is some code I played around with, but it doesn't work, I could
only translate and scale the texture OR rotate it, but I need to do all at
the same time

Private Sub SetupTexMatrix(matOut As D3DMATRIX, tY As Single, tX As Single,
oX As Single, oY As Single, rotation As Single)
matOut.m11 = tX: matOut.m12 = 0#: matOut.m13 = 0#: matOut.m14 = 0#
matOut.m21 = 0#: matOut.m22 = tY: matOut.m23 = 0#: matOut.m24 = 0#
matOut.m31 = oX: matOut.m32 = oY: matOut.m33 = 1#: matOut.m34 = 0#
matOut.m41 = 0#: matOut.m42 = 0#: matOut.m43 = 0#: matOut.m44 = 0#

Dim rmat As D3DMATRIX
D3DXMatrixIdentity rmat
D3DXMatrixRotationZ rmat, rotation

D3DXMatrixMultiply matOut, matOut, rmat
End Sub

this function should set up an whole matrix with all needed transformations,
but it doesn't work :(

I don't have the C++ DX8 samples...

Cu, Marius



Quote:
> search for D3DTS_TEXTURE in the samples on the C++ side for an example
> usage, and then translate to VB.

> I see that the Moire Screensaver sample as well as BumpWaves and BumpLens
> make use of texture transforms. Also Tutorial 5.
> --
> Phil Taylor



> > How could I calculate an matrix to scale/rotate/translate an texture on
my
> > geometry?



Wed, 20 Apr 2005 05:37:45 GMT  
 Texture-matrix
please....help......me...... :(

I thought there are some M$ guys on this newsgroup, why couldn't they help,
if even M$ don't know how to use D3D.... ;)



Quote:
> In the DX8 SDK there is already an sample about texture-animation (the
> animation is commented out)

> Ok, here is some code I played around with, but it doesn't work, I could
> only translate and scale the texture OR rotate it, but I need to do all at
> the same time

> Private Sub SetupTexMatrix(matOut As D3DMATRIX, tY As Single, tX As
Single,
> oX As Single, oY As Single, rotation As Single)
> matOut.m11 = tX: matOut.m12 = 0#: matOut.m13 = 0#: matOut.m14 = 0#
> matOut.m21 = 0#: matOut.m22 = tY: matOut.m23 = 0#: matOut.m24 = 0#
> matOut.m31 = oX: matOut.m32 = oY: matOut.m33 = 1#: matOut.m34 = 0#
> matOut.m41 = 0#: matOut.m42 = 0#: matOut.m43 = 0#: matOut.m44 = 0#

> Dim rmat As D3DMATRIX
> D3DXMatrixIdentity rmat
> D3DXMatrixRotationZ rmat, rotation

> D3DXMatrixMultiply matOut, matOut, rmat
> End Sub

> this function should set up an whole matrix with all needed
transformations,
> but it doesn't work :(

> I don't have the C++ DX8 samples...

> Cu, Marius



> > search for D3DTS_TEXTURE in the samples on the C++ side for an example
> > usage, and then translate to VB.

> > I see that the Moire Screensaver sample as well as BumpWaves and
BumpLens
> > make use of texture transforms. Also Tutorial 5.
> > --
> > Phil Taylor



> > > How could I calculate an matrix to scale/rotate/translate an texture
on
> my
> > > geometry?



Sat, 23 Apr 2005 05:02:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Weird texture matrix problem

2. Texture mapping?

3. Texture polygons

4. Texture maps...

5. 3D texture-mapping , shading, and filling........

6. BASIC in TeXtures

7. Game textures etc

8. Background textures for forms

9. Textured BackGround colour

10. How to use a special texture using FloodFill ?

11. Textures

12. Vb and textures

 

 
Powered by phpBB® Forum Software