Jump to content
  • Advertisement

Archived

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

stevenmarky

ID3DXSprite - Z order - HELP!!!

This topic is 6104 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

I am currently making an engine for a isometric game, using ID3DXSprite. Is there a easy way to specify the order of draw, since it is using 3d hardware is there a way for some sprites to be closer to the screen, and some further away? (Z ordering).Im not a 3D programmer but I know the one of the functions (DrawTransform) of D3DX Sprite takes a matrix as a parameter (and you use matrices to change things in 3d space) - can I use this to control Z ordering? It would save a lot of time. Thanks, Steven R Edited by - stevenmarky on February 1, 2002 6:06:25 PM

Share this post


Link to post
Share on other sites
Advertisement
Im not a 2D programmer like you are not a 3D programmer , but can''t you implement a virtual Z-Order, hence on render you would render in this specific order? Every object doesnt need a unique z-order.

-------
Happy Coding!
Homepage: www.pcwebvia.f2s.com CVS1.0 will be released soon here.
www.bytamin-c.com

Share this post


Link to post
Share on other sites
You are right, every object doesnt need a specific z order, but the game will be isometric and several layers of tiles will have the same z order, but there are obejcts, special effects chacracters, monsters some in front of the other - the easiest way would be to specify a z value for a object, lukily I have found this on gamasutra:

Finally, for those wishing to go one step further, and maybe even dip your toes into 3D waters, the ID3DXSprite interfaces offer an alternate version of the Draw() function, called DrawTransform(). Instead of taking scaling, rotation, and translation (positioning) information, the DrawTransform() function takes a transformation matrix, which defines the geometrical transformations for every pixel using a 4x4 matrix. Using this you gain access to effects involving the Z-axis, meaning distances closer to or farther from the viewer. A popular effect is perspective, which would give your image the impression of receding into the distance. The use of transformation matrices is far beyond the scope of this article, but for those interested you can start with "About 3-D Transformations" in the DirectX 8 SDK and go from there. Be prepared to dig out your old math textbooks.


Now all I need to work out is how to put things in front out of the other (z-order) so they dont get bigger, or are affected by perspective!!
Has anyone used this method before?

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!