I have transparency now and i beginning texturing.
I just need to check the rule for drawing to be more accurate with .obj model (basically change to parameter and take the best result).
I need to parse and to rewrite all the path for texture it did not find (every texture in fact, blender export in a really strange way). 
And in addition there are plenty of different kind of texture and I need to learn OpenGL. :-)
i already success to texturing the vador starship. I need to generalise process now.



On Jul 18, 2012, at 7:37 AM, Tudor Girba wrote:

Very nice!

Doru


On 17 Jul 2012, at 14:21, Jean Baptiste Arnaud wrote:

Hi,
Under the pressure of Camillo i publish the code.
I beginning to do a Wavefront (human readable standard for 3d Obj Model ) importer on Pharo.

So i made a importer.
Not all the case are manage, only the case I need to import the current Obj model.

And a drawer which is in Alpha version.
face and normal vector are manage.
Missing color (in progress), and texturing.

You need .obj file and all the .mtl related (open you blender and make it nice).

If you are not running on Mac os comment this code in GLWorldTest>>#render, the

display makeCurrent.

else if you running on mac os implement it in
NBMSAAOffscreenDisplay>>#makeCurrent
^driver makeCurrent.

My code can be find on JBARepo on squeaksource
ObjModel Package but you need NBOpenGL (i do a configuration in same place i just need to be motivated for keep it up to date).

So
put on same folder of the .image your .obj and .mtl file (i am lazy) (maybe it is VM folder i do not know).
open a workspace and do

"s := ObjImporter importFrom: 'xwing-map.obj'.
s parse.
object := s objects.

w := GLWorldTest new.
object do: [:e | w addElement: e].
w openInWorld."

3d result with normal
<Screen Shot 2012-07-17 at 1.59.22 PM.png>


With normal and color but not texture :

<Screen Shot 2012-07-17 at 1.58.18 PM.png>

Enjoy




Best Regards
Jean Baptiste Arnaud
jbaptiste.arnaud@gmail.com








--
www.tudorgirba.com

"To utilize feedback, you first have to acquire it."



Best Regards
Jean Baptiste Arnaud