Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

sj

A question

This topic is 6017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!