NewbieQ - Moving a loaded mesh 
Author Message
 NewbieQ - Moving a loaded mesh

Hi folks!
You have probably seen this question a zilion times but
Im relative new to programing Direct3d....
I have loaded 2 meshes (mesh.fromfile).
Now I want to move one of them and at the same time
rotate and scale it a bit. How do I do this? I have tried
doing
        m = Matrix.Translation(30, 30, 0)
        m = Matrix.RotationY(y)
        m = Matrix.Scaling(0.2, 0.2, 0.2)
        Device.Transform.World = m
but it only scales the mesh down...
Plz help!
    DDman


Tue, 21 Jun 2005 02:41:59 GMT  
 NewbieQ - Moving a loaded mesh
with a mesh at the origin, scale, then rotate, then translate.

if the mesh isnt at the origin, translate it first, then perform the above.


Quote:
> Hi folks!
> You have probably seen this question a zilion times but
> Im relative new to programing Direct3d....
> I have loaded 2 meshes (mesh.fromfile).
> Now I want to move one of them and at the same time
> rotate and scale it a bit. How do I do this? I have tried
> doing
>         m = Matrix.Translation(30, 30, 0)
>         m = Matrix.RotationY(y)
>         m = Matrix.Scaling(0.2, 0.2, 0.2)
>         Device.Transform.World = m
> but it only scales the mesh down...
> Plz help!
>     DDman



Tue, 21 Jun 2005 03:37:54 GMT  
 NewbieQ - Moving a loaded mesh
Note also that you should *combine* them all in the order described by Phil.
This is usually done by multiplying the current matrix but the next
transformation matrix. In your code snippet you should just create each time
a new matrix levaing just the last one for the world transform...



Quote:
> Hi folks!
> You have probably seen this question a zilion times but
> Im relative new to programing Direct3d....
> I have loaded 2 meshes (mesh.fromfile).
> Now I want to move one of them and at the same time
> rotate and scale it a bit. How do I do this? I have tried
> doing
>         m = Matrix.Translation(30, 30, 0)
>         m = Matrix.RotationY(y)
>         m = Matrix.Scaling(0.2, 0.2, 0.2)
>         Device.Transform.World = m
> but it only scales the mesh down...
> Plz help!
>     DDman



Wed, 22 Jun 2005 03:37:47 GMT  
 NewbieQ - Moving a loaded mesh
Hi,

I'm also a newbie, but just to expand on what the others
have said, you need to concatenate your matrices. I
assume you're using DX9 which I have not yet looked at.
In dx8, you use the d3dxMatrixMultiply (mOut, m1,m2) to
concatenate the matrices. I assume there is some similar
method in VB.NET with DX9.

good luck

Quote:
>-----Original Message-----
>Hi folks!
>You have probably seen this question a zilion times but
>Im relative new to programing Direct3d....
>I have loaded 2 meshes (mesh.fromfile).
>Now I want to move one of them and at the same time
>rotate and scale it a bit. How do I do this? I have
tried
>doing
>        m = Matrix.Translation(30, 30, 0)
>        m = Matrix.RotationY(y)
>        m = Matrix.Scaling(0.2, 0.2, 0.2)
>        Device.Transform.World = m
>but it only scales the mesh down...
>Plz help!
>    DDman

>.



Sat, 25 Jun 2005 17:54:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Moving mesh?

2. Moving Meshes

3. Move a mesh

4. Mesh Names or Mesh Subset Names

5. Mesh Picking, Boned Animation, Faked Meshes

6. Loading Multiple Identical Meshes

7. Progressive meshes / Simplifying meshes

8. i want save a mesh just loaded

9. NewbieQ: MsgBox on Form Open

10. Should everything a Class Module? NewbieQ

11. NewbieQ: Where to store private data?

12. NewbieQ - Accessing controlls

 

 
Powered by phpBB® Forum Software