2d sprite in 3d space

Hi! I’m new here and I’m loving JMonkey 3.

Last year I took a course in Java, and I finished my first project, an IRC bot, and now I’m doing something more difficult like a small game in JMonkey.

Anyway to the point, how do you show a 2d sprite in 3d space? You know, like how they did it on the Nintendo 64 for sprites that were too poly rich to render directly (or too populated), like the trees in Mario 64.

It doesn’t need to scale, but it would be nice to know how this would be done too. Am I missing something in the API, I can’t find it, if someone can point it out if it is there, I’m sorry.

I’d think you can make a quad and every camera update make it face the camera? Then I’ll have too look into 3d math, I can do that. But is there a simpler way?

'tWill be used for a simple puzzler game I’m making for android. The camera is fixed most of the time so I would like to make the “coins for score” 2d sprites instead of GPU intensive complex 3d meshes. The area itself is in 3d and only moves on X and Y axis mainly.

Kind regards,
Joey

@Joey-Peters said: I'd think you can make a quad and every camera update make it face the camera? Then I'll have too look into 3d math, I can do that. But is there a simpler way?

For this, you can use the BillboardControl
http://jmonkeyengine.googlecode.com/svn/trunk/engine/src/test/jme3test/model/shape/TestBillboard.java

2 Likes

Wow that’s quick! Thanks, that’s exactly what I needed.

Didn’t know this was called Billboarding. Still learning the 3d technical terms :wink:

1 Like