Sunday, January 20, 2008

Technical: Texture with Java3D

Following on our meeting with supervisor, we start to look more into Textures with Java3D. 
We have got a nicely done LetterA with 3D modeling software, and were wondering if the same results can be achieve using Java3D. 
Rendered using 3D Modeling Software. 

The 2D-image used for the texture


The Results

Now we have 3 different types of A, with the same image used for mapping but different technique. 
The TexCoordGeneration object is responsible for all parameters required for automatic texture coordinate generation. It is part of the Appearance component object.  

A simple example of code will be like

TexCoordGeneration t = new TexCoordGeneration(generation mode, format);


Texture Generation Mode

- OBJECT_LINEAR (a linear function in object coordinates)

- EYE_LINEAR (a linear function in eye coordinates) 

- SPHERE_MAP (spherical reflection mapping in eye coordinates)

Texture Format 

- TEXTURE_COORDINATE_2 (generates 2D texture coordinate)

- TEXTURE_COORDINATE_3 (generates 3D texture coordinate)


Blur? Nevermind, as the examples shown above. First A (from left) is using SPHERE_MAP; Middle A is using EYE_LINEAR and our Last A is using OBJECT_LINEAR.


Another example

All three A are mapped using the image (4th from left), using different Texture Generation Mode. 


Conclusion:

Texture can be applied. However, results were not as expected. Seem lotsa unfeasible work need to be done such as: 

1) individual letters need their own custom texture. A letter 'A' texture might not work for a letter 'B'

2) If we skew/rotate/transform the work, the texture cords will run as well..

3) texture image size are not small, still looking at whether it affect CPU time/loading time on mobile devices.

4) automatic coordinates mapping using the "Texture Generation Mode" seem not that outstanding, wondering if a manual mapping will do the job... meaning more extra work..  

No comments:

Post a Comment