<!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 &lt;<A 
href="mailto:dave_faught@yahoo.com">dave_faught@yahoo.com</A>&gt; 
wrote<BR><BR>&gt; I am trying to do the tutorial included in the B3DDemo.zip 
file, which<BR>&gt; is pointed to by the minnow swiki (which seems to be gone 
right now)<BR>&gt; documentation section on graphics.<BR>&gt; <BR>&gt; It 
appears that the ambient lighting does not work, or something like<BR>&gt; 
that.&nbsp; The rotating cylinder example and the other objects that I 
have<BR>&gt; tried to create always come out black.&nbsp; The rotating cylinder 
does have<BR>&gt; a spot of blue right at the origin, but is otherwise 
black.&nbsp; I have<BR>&gt; tried adding an ambient light, but this does not 
help anything.<BR>&gt; <BR>&gt; Any ideas what I need to do here?<BR>&gt; <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&nbsp;use&nbsp; Color 
white<BR>as&nbsp; ambient part of that material.</DIV>
<DIV>&nbsp;</DIV>
<DIV>When you experiment with B3DSceneMorph&gt;&gt;createDefaultScene</DIV>
<DIV>(as proposed in the tutorial), you may wish to try this: (my additions 
in</DIV>
<DIV>boldface types)</DIV>
<DIV>&nbsp;</DIV>
<DIV>createDefaultScene<BR>&nbsp; &nbsp;| sceneObj camera <STRONG>mat 
ambientLight </STRONG>|<BR>&nbsp; &nbsp;sceneObj _ B3DSceneObject named: 'Sample 
Cube'.<BR>&nbsp;&nbsp; sceneObj geometry: (B3DIndexedMesh 
vrml97Cylinder)..<BR>&nbsp;&nbsp;&nbsp;<STRONG>mat := B3DMaterial 
new.<BR>&nbsp;&nbsp; mat ambientPart: (Color gray: 0.99).&nbsp;</STRONG></DIV>
<DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;" this 
is suitable for ambient light of all colors. 
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " change the 
ambient part to see how this property 
works<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; together with the color of the ambient light. "</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<STRONG>sceneObj material: mat.</STRONG><BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;camera _ B3DCamera new.<BR>&nbsp;camera position: <A 
href="mailto:0@0@-1.5">0@0@-1.5</A>.<BR>&nbsp;self extent: 
100@100.<BR>&nbsp;scene _ B3DScene new.<BR>&nbsp;scene defaultCamera: 
camera.<BR>&nbsp;scene objects add: sceneObj.</DIV>
<DIV><STRONG>&nbsp;&nbsp;ambientLight :=B3DAmbientLight 
new.&nbsp;<BR>&nbsp;&nbsp;ambientLight lightColor: (B3DMaterialColor color: 
Color green).&nbsp;<BR>&nbsp; scene lights add: ambientLight</STRONG>.<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Remarks:</DIV>
<DIV>1. A B3DMaterial defines the visual properties of a solid.</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Without a material, a solid is indeed a piece of 
coal.</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. (Color gray: 0.99) is almost the same as Color white.</DIV>
<DIV>3. You may wish to try</DIV>
<DIV>&nbsp;&nbsp;&nbsp; mat ambientPart: (Color r: 0.7 g: 0.7 b: 0.0)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;and study the effect of different ambient light 
colors.</DIV>
<DIV>&nbsp;&nbsp;&nbsp; (You&nbsp;should see that the body reflects red, green 
and</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; colors that are mixed from red and green)&nbsp; 
<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>Look also at&nbsp; 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>&nbsp;</DIV>
<DIV>Greetings, Boris</DIV></BODY></HTML>