A question
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.
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;
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;
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
Frank
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement