Display fonts in XNA with 3-dimensional coordinate primitives
I am making a simulation with XNA 4.0.
We can display fonts but onl开发者_开发知识库y with 2D coordinates, I need to display fonts with 3D coordinates. Please Help any technique how can i accomplish this.
In XNA 4.0, SpriteBatch.Begin
can take any Effect
. You can pass in a BasicEffect
with an arbitrary set of transformation matrices (World
, View
, Projection
) that will be used to transform your sprites, allowing you to "place" them in 3D space.
The "models" that SpriteBatch
creates (basically a quad each sprite/letter) are the same size in units as the associated bitmap is in pixels.
Typically you'd treat the sprite plane as a model, and move it around using the World
matrix.
The blog posts here and here explain it in more detail.
精彩评论