libgdx decal dynamic text -



libgdx decal dynamic text -

i'm working on 3d (2.5d) application in libgdx. i've found decals useful purpose.

in app there should layers, contain dynamical text, i'm wondering best way draw text via decals.

currently implementation based on drawing bitmapfont fbo, fbo texture , bind decal before decalbatch.flush().

i think maybe not efficient way of doing this, can't figure out improve way.

my app can contain big number of text "layers" placed 3d world, maybe drawing each bitmapfont fbo, , binding fbo texture decal isn't best approach.

do guys have improve idea? efficient way of doing this?

tnx in advance!

you can draw straight 3d space spritebatch assigning projection matrix appropriately.

first, have matrix4 determines position , rotation of each of strings of text. reason need spritebatch , bitmapfont not have arguments z offset.

since can set translation matrix4, when phone call draw method, draw 0,0.

you can utilize matrix4 of each mesh multiply camera's combined matrix before submitting spritebatch. want separate matrix4 doing calculations.

class="lang-java prettyprint-override">texttransform.idt().scl(0.2f).rotate(0, 0, 1, 45).translate(-50, 2, 25f); //probably need scale down. scale before moving or rotating. spritebatch.setprojectionmatrix(tmpmat4.set(camera.combined).mul(texttransform)); spritebatch.begin(); font.draw(spritebatch, "testing 1 2 3", 0, 0); spritebatch.end();

text libgdx decal

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -