A question

Started by
1 comment, last by sj 22 years, 1 month ago
OK. This is probably quite basic stuff, but how can I make two separate rectangles that can be moved around? I know how to make a single rectangle and how to change its position using a matrix. Thanks.
Advertisement
you need two sets of geometry - 2 vertex buffers, 2 arrays of vertices (whichever). you then do 2 seperate rendering calls, one for each buffer/array.

You''ll need to construct 2 / reconstruct the world matrix for each rectangle... and use the Device->SetTransform() function to apply it...

eg,
<-begin scene ->
1. set world matrix for first rect.
2. render first rect
3. set world matrix for 2nd rect
4. render 2nd rect
<- end scene ->

hth
Jack;

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

it''s better to use 1 vertex buffer for all your sprites (each set of geometry listed one after the other). You still do 2 seperate calls as Jack said, you pass the appropriate vertex offset in each one.

Frank

This topic is closed to new replies.

Advertisement