multiple mesh locations - dx8 
Author Message
 multiple mesh locations - dx8

i've loaded a .x file into memory and i want to place it in multiple locations through my world. would someone be able to give me a
bit of a code snippet or write a very simple program which loads 1 mesh and places it in 2 or more locations so that i can go
through the code line by line and work out what is going on. i'm still having problems. no matter what i do i can only get the mesh
to be displayed once.


Sun, 07 Nov 2004 12:56:39 GMT  
 multiple mesh locations - dx8
set world transform to location 1.

draw mesh.

set world transform to location 2.

draw mesh.

--
Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> i've loaded a .x file into memory and i want to place it in multiple

locations through my world. would someone be able to give me a
Quote:
> bit of a code snippet or write a very simple program which loads 1 mesh

and places it in 2 or more locations so that i can go
Quote:
> through the code line by line and work out what is going on. i'm still

having problems. no matter what i do i can only get the mesh
Quote:
> to be displayed once.



Sun, 07 Nov 2004 13:15:28 GMT  
 multiple mesh locations - dx8
i still don't get u. here is the code i have. would u be able to edit it so that it will display the mesh 2 times next to each
other?

    Dim matRotate As D3DMATRIX
    Dim matTrans As D3DMATRIX
    Dim matScale As D3DMATRIX
    Dim matWorld As D3DMATRIX

    D3DXMatrixRotationAxis matRotate, vec(0, 0, 0), rad(0)
    D3DXMatrixTranslation matTrans, 0, 0, 0
    D3DXMatrixScaling matScale, 1, 1, 1

    D3DXMatrixMultiply matWorld, matRotate, matTrans
    D3DXMatrixMultiply matWorld, matScale, matWorld
    'D3DXMatrixMultiply matWorld, matWorld, matObject

    g_D3DDevice.SetTransform D3DTS_WORLD, matWorld

    Render    ' Time to render



Sun, 07 Nov 2004 13:39:10 GMT  
 multiple mesh locations - dx8
To restate the good advice Phil give you, in code, would be:

D3DXMatrixTranslation matWorld, 0, 0, 0    'Your location 1
g_D3DDevice.SetTransform D3DTS_WORLD, matWorld

Render    ' Time to render

D3DXMatrixTranslation matWorld, 10, 10, 10    'Your location 2
g_D3DDevice.SetTransform D3DTS_WORLD, matWorld

Render    ' Time to render

--
Eric DeBrosse
http://www.mvps.org/vbdx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Mon, 08 Nov 2004 01:31:40 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Loading Multiple Identical Meshes

2. Mesh Names or Mesh Subset Names

3. Mesh Picking, Boned Animation, Faked Meshes

4. Some problems DX8.0-DX8.1

5. Progressive meshes / Simplifying meshes

6. UserForm data in multiple locations

7. Set DB location for multiple reports ...

8. document.location or window.location Question

9. Run Time Change of DB Location, Setting Passwords, and Rpt Location

10. Connection cursor location vs. Recordset cursor location

11. Copying files from different locations to different locations

12. Mesh generation

 

 
Powered by phpBB® Forum Software