Re: 2D in D3D

From: Chris Hastings (
Date: 10/08/04

Date: Fri, 8 Oct 2004 09:31:46 -0500

Have you looked at using a different render target? That way you can render
to a single texture, and then display the texture transformed and each one.
Also, have you tried just changing the camera position?
If you need to rotate each sprite individually, rather than rotate the whole
scene, I think you need to do what you are doing, but if you just want to
move everything left or right, or rotate the entire scene, Move the camera
with (change view matrix with matrix.LookatLH) or render to a texture
(created with usage.RenderTarget and pool.default) using RenderToSurface
I hope that's what you are asking, let me know if that helps.

"Jeff" <> wrote in message
> I'm currently using Direct3D.Sprite to draw several hundred sprites to the
> screen and I would like to be able to rotate all of the sprites (as if the
> camera was rotating) or scale them (as if the camera was zooming in or
> out).
> I know I can translate and scale each one of them individually using the
> Sprite.Transform method, however, shouldn't it be as easy as just moving
> the camera and letting D3D render them at the appropriate rotation/scale
> based off the position of the camera?
> Same thing with translation... instead of moving hundreds of sprites to
> the left each frame (to simulate scrolling) wouldn't it be better to just
> move ONE camera to the right each frame?

Relevant Pages

  • Re: Tile-based game
    ... >> tile images that can be used on the map. ... Is it possible to render the entire ... >> 2) Do I have to create sprites for every single visible tile? ... > batches of quads using the vertices texture coordinates ...
  • Re: Tile-based game
    ... > tile images that can be used on the map. ... You can fit all of the sprites in a single 256x256 texture, then render ...
  • Re: 2D in D3D
    ... At initialization, I render all of that to a texture, then ... That works for me because the background sprites aren't changing, ... just may need to move the whole scene around. ...
  • Re: 2D in D3D
    ... Is there a way to have the camera affect the ... I guess I could draw all my sprites to a single texture and then ... render that texture transformed, however, that seems like it would add a bit ...
  • Re: 2D in D3D
    ... These sprites will all be moving ... I couldn't just simply draw them once. ... At initialization, I render all of that to a texture, ...