<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><BR>David Faught <<A
href="mailto:dave_faught@yahoo.com">dave_faught@yahoo.com</A>>
wrote<BR><BR>> I am trying to do the tutorial included in the B3DDemo.zip
file, which<BR>> is pointed to by the minnow swiki (which seems to be gone
right now)<BR>> documentation section on graphics.<BR>> <BR>> It
appears that the ambient lighting does not work, or something like<BR>>
that. The rotating cylinder example and the other objects that I
have<BR>> tried to create always come out black. The rotating cylinder
does have<BR>> a spot of blue right at the origin, but is otherwise
black. I have<BR>> tried adding an ambient light, but this does not
help anything.<BR>> <BR>> Any ideas what I need to do here?<BR>> <BR>A
piece of coal will be black under any light. To see the effect of<BR>ambient
light, you have to look at a body that reflects colored<BR>light. Ideally, you
use a body that reflects all colors.<BR><BR>Translated into the language of B3D,
this means that you have to<BR>"cover" your scene object with a material that
reflects</DIV>
<DIV>colored light. For best results, you should use Color
white<BR>as ambient part of that material.</DIV>
<DIV> </DIV>
<DIV>When you experiment with B3DSceneMorph>>createDefaultScene</DIV>
<DIV>(as proposed in the tutorial), you may wish to try this: (my additions
in</DIV>
<DIV>boldface types)</DIV>
<DIV> </DIV>
<DIV>createDefaultScene<BR> | sceneObj camera <STRONG>mat
ambientLight </STRONG>|<BR> sceneObj _ B3DSceneObject named: 'Sample
Cube'.<BR> sceneObj geometry: (B3DIndexedMesh
vrml97Cylinder)..<BR> <STRONG>mat := B3DMaterial
new.<BR> mat ambientPart: (Color gray: 0.99). </STRONG></DIV>
<DIV><STRONG> " this
is suitable for ambient light of all colors.
"<BR> " change the
ambient part to see how this property
works<BR>
together with the color of the ambient light. "</STRONG></DIV>
<DIV> </DIV>
<DIV> <STRONG>sceneObj material: mat.</STRONG><BR></DIV>
<DIV> </DIV>
<DIV> camera _ B3DCamera new.<BR> camera position: <A
href="mailto:0@0@-1.5">0@0@-1.5</A>.<BR> self extent:
100@100.<BR> scene _ B3DScene new.<BR> scene defaultCamera:
camera.<BR> scene objects add: sceneObj.</DIV>
<DIV><STRONG> ambientLight :=B3DAmbientLight
new. <BR> ambientLight lightColor: (B3DMaterialColor color:
Color green). <BR> scene lights add: ambientLight</STRONG>.<BR></DIV>
<DIV> </DIV>
<DIV><BR>Remarks:</DIV>
<DIV>1. A B3DMaterial defines the visual properties of a solid.</DIV>
<DIV> Without a material, a solid is indeed a piece of
coal.</DIV>
<DIV> </DIV>
<DIV>2. (Color gray: 0.99) is almost the same as Color white.</DIV>
<DIV>3. You may wish to try</DIV>
<DIV> mat ambientPart: (Color r: 0.7 g: 0.7 b: 0.0)</DIV>
<DIV> and study the effect of different ambient light
colors.</DIV>
<DIV> (You should see that the body reflects red, green
and</DIV>
<DIV> colors that are mixed from red and green)
<BR></DIV>
<DIV> </DIV>
<DIV>Look also at B3DDemoSpheres example3</DIV>
<DIV>for an example that uses ambient light and a material that</DIV>
<DIV>reflects ambient light.</DIV>
<DIV><BR>I hope this helps, but feel free to ask again if it does not!</DIV>
<DIV> </DIV>
<DIV>Greetings, Boris</DIV></BODY></HTML>