Rendering a text in 3d using opengl

Problems with Canvas, OpenGL, etc...

Rendering a text in 3d using opengl

Postby iappdev » Thu Jun 10, 2010 6:56 am

Hi,

I am a novice android developer. Can somebody here point me to 3d text rendering tutorial using OpenGL ?
iappdev
Freshman
Freshman
 
Posts: 9
Joined: Mon Apr 12, 2010 12:13 pm
Location: Pune India

Top

Re: Rendering a text in 3d using opengl

Postby gskbyte » Thu Jun 10, 2010 4:09 pm

Draw it on a Texture and then map it to a quad or two triangles.
gskbyte
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Tue Jan 12, 2010 1:51 pm

Re: Rendering a text in 3d using opengl

Postby dinamic » Fri Jun 11, 2010 6:52 am

1. Create a empty Bitmap
2. wrap bitmap into a Canvas
3. Set canvas font/size etc..
4. Make an algo to write all characters you want to use into bitmap
make shure algo stores text extends height=same for all, width, x and y for each character
this is used for mapping texture to qauds...
5. Convert bitmap argb to rgba byte array (direct allocated)
6. Generate the GL texture...
7. Implement a renderText(string) that uses the coords map to texturemap each quad representing each character
in string...

/h
dinamic
Freshman
Freshman
 
Posts: 8
Joined: Thu Jun 10, 2010 2:31 pm

Re: Rendering a text in 3d using opengl

Postby luugiathuy » Fri Jun 11, 2010 7:38 am

There's an example about this on apps-for-android google code project:

http://bit.ly/cna9Wb

Hope this helps!
luugiathuy
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Jun 01, 2010 3:16 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests