Como eu fa?o para mover apenas a chaleira

Como eu fa?o para mover apenas a chaleira

Post by Robert Dunlop [MS MVP » Fri, 12 Jul 2002 05:17:13



Calling SetTransform() with NULL does not set an identity transform, it
is an invalid call.  Instead, set up an identity matrix and pass it to
SetTransform(), like this:

D3DXMATRIX mat;
D3DXMatrixIdentity(&mat);
lp_device->SetTransform(D3DTS_WORLD ,&mat);
lp_device->DrawPrimitive(D3DPT_TRIANGLELIST,0,1);

Also, why do you use both lp_device and g_d3d.lp_device?  I assume these
point to the same device?
--
Robert Dunlop
The X-Zone
http://www.mvps.org/directx
Microsoft DirectX MVP
-------------
The opinions expressed in this message are my own personal views and do
not reflect the official views of the Microsoft Corporation.
The MVP program does not constitute employment or contractual obligation
with Microsoft.



Quote:> Could anyone tell me what I made wrong? .

> I developed a small application to learn direct3d in which I I have a
> triangle and an object mesh teapot. I wanted to move only the teapot,
and
> for this I loaded into the worldmatrix the identity and rendered the
> triangle, then I modified the worldmatrix and rendered the teapot but
the
> triangle also moved. This procedure is made in the method render of
the
> class D3DEVILTHING and the worldmatrix is modified in the Loop of
WinMain();

> The keyboard keys for navigation are:
> e: moves the camera  to the left
> s:  moves the camera downwards
> d: moves the camera to  the right
> w: moves the camera  upwards
> f:  moves the camera backwards
> r: moves the camera front

> It is necessary that some windows event occur to see the movement (to
move
> mouse is enough) The code source and the data are attached

> Digenes.
> Amok Entertainment