Sprites in 3d space.

se5a

18-12-2013 21:19:34

Hi,
I'm wanting to attach 2d sprites to a node and move them as you would a typical mesh. but I'm unsure how to go about this.
all the info I've found regarding 2d stuff seems to be talking about doing everything relative to the screen, which is not what I want at all.
I guess I need to create a 2dmesh then attach a texture to it. is there an easy way to do this? every time I look at this route I get quickly confused.

Beauty

07-01-2014 19:35:17

Meshes are 3D objects.
Overlays are commonly used to be relative to the screen.

For sprites in 3D space you can use billboards.
These are 2D objects, which you can attach to SceneNodes and apply a texture.
Have a look to the links on the bottom of the billboards wiki page. They point to interesting pages.

If you want to display plain text, have a look to the wiki page MOGRE MovableText by Billboards

se5a

10-01-2014 07:39:07

I would say it's the same effect.
Maybe billboards works in the same way as creating a quad (2 triangles) with texture.
But I don't know this Ogre internal.

Possibly billboards are more easy to use for sprites??
I don't know. I never used billboards. I only used ManualObjects without textures (I just defined colour effects in the material files).

I got one more idea:
To display a flat texture in 3D space you can also use the Plane class or the MovablePlane class. (API documentation here and here)
Some example code for planes you find here: http://www.ogre3d.org/tikiwiki/Intermediate+Tutorial+5