how to begin with Ballon3D?

Boris Gaertner Boris.Gaertner at gmx.net
Wed May 5 12:28:09 UTC 2004


From: Joei (xuying at cs.inf.shizuoka.ac.jp) wrote:

Welcome to the community of Squeak!
>>But I found out that I still cannot place a texture to a
>>geometric object successfully.
Let us look to this problem in some detail.
The example
       B3DDemoSurfaces example1.
should show two intersecting surfaces that are
colored with textures: One with a green chess-board
pattern, the other with a red one.
An white ambient light is added to the scene -
without that light both surfaces would appear
black! This is very important. To see a texture,
you have to use either a scene light (white ambient
light is always a good start) or you have to add a
material with light emission to your geometric object.
This is done with:

     mat := B3DMaterial new.
     mat emission: (Color gray: 0.99). 
     sceneObj material: mat. 


A texture is an image that you place on an objects
surface. You cannot use a form directly, you have
to send it the message  #asTexture  to convert it into
a texture.

When you use a texture, you have to add the
texture to the scene object and texture coordinates
to the mesh. Texture coordinates are an instance of
B3DTexture2Array. The elements are points - 
one for every vertext of the mesh). point coordinates
in the range  0.0  ..  1.0  are mapped  onto the texture.
for point coordinates outside that range the texture
is repeated.

     
>>So, the question is: How to program with Balloon3D? or
>>Where I can find more documents about it.
I should impprove the tutorial, really. Regrettably this
requires some time.


The examples of the tutorial were written for an
earlier version of Balloon3D. Later the automatic
computation of vertext normals was removed and that
is the reason that some examples appear black.
Attached you find a change set that adds the computation
of vertex normals. Vertex normals are needed when
geometric objects are colored with directed lights.
The fix contains also a button in the presenter
window that you can use to switch to hardware
acceleration. (This requires OpenGL!)


Greetings,
Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: B3DTutorialFix.zip
Type: application/x-zip-compressed
Size: 2740 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040505/12e24aa4/B3DTutorialFix.bin


More information about the Squeak-dev mailing list