Jump to content
  • Advertisement
Sign in to follow this  
Mathius21

c# Sprite class

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

Hey, I had a few questions in regards to the c# Sprite class. First of all, is it possible to modify the vertex format of the sprite? I wanted to be able to add normals so that I could use the sprites in 3d world space. Which is my next question. Is it possible to render sprites in world space instead of screen space. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I'm not familiar with c# or sprite theory... but i would assume you just texture it to a geometrical object. I know directx provides functionality to texture quads. ... as far as the changing the vertex structure you may have to create your own class if it is not a variable ie hardcoded.
Hope this helps.
-durfy

Share this post


Link to post
Share on other sites
It would be rather helpfull if you told us what library you're using: there's no "c# sprite class". I'm assuming you're using managed directx?

If so, then yes, you can render sprites in world space. That's why there's both "Draw" and "Draw2D" functions.

As for vertex declarations, I don't know from my own experience. But try an experiment: assign a vertex declaration, start rendering with the "DoNotModifyRenderState" flag, and see if that works.

I know that Xna's sprite implementation allows you to specify custom shaders, which need a vertex declaration. Considering Xna's spritebatch class just wraps a directx sprite, this suggests it's possible.

[Edited by - gharen2 on July 26, 2007 12:13:54 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!