Sign in to follow this  
xWize

Best Way To Do 2d Rendering

Recommended Posts

Hi all, can anyone give me some advice on rendering 2d stuff with d3d. Should i use the sprite interface, or use quads, and what the hell is d3d surface all about? Also, if i were to use quads and set up an ortho projection, that would scale all the things on screen so that they are of the same proportions regardless of screen resolution, right? Cheers.

Share this post


Link to post
Share on other sites
Hi xWize.

I've heard that a lot of people have trouble with D3DXSprite due to texture mapping issues (though that may have been fixed now). If you're not so bothered about 1-1 pixel-texel mapping then it could ease some of the work for you. Otherwise, it really isn't too much hassle to create your own sprite class. There are tutorials about this sort of thing all over the web. This article is particularly complete.

A surface is simply a block of memory (system or video) designated for storing planar images, either as sources (e.g. textures) or destinations (e.g. render-target). You may want to think of it as an off-screen buffer, though it need not have any particular resolution. Often there is no need to work with surfaces directly. Unless you are rendering-to-texture or per-pixel-processing, all of the surface business is abstracted away from you under the guise of the Direct3DTexture class, Device->Present() function etc.

Orthographic projection is the second most commonly-used projection after perspective. The world in which we live exhibits perspective, whereby objects appear smaller the further away they get. Orthographic projections don't have this property - an object is always as big as it is big. While not very useful for real-time 3D rendering, orthographic projections are routinely used in 3D modelling (where perspective can play tricks on your eyes) and in 2D emulation: Here you can use the distance (usually z) coordinate to represent depth without having to worry about the sprites shrinking into the distance.

Regards
Admiral

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this