Hi,

Maybe you have to tell the box to generate normals - you are using a material
and lighting to colour the box.  To do this use the following constructor to
create the box:

  Box box1 = new Box(40.0f, 50.0f, 60.0f, Box.GENERATE_NORMALS, ap)

Hope this helps,
--Renoir

"A. Murat Tanyer" wrote:

> Dear Java3D members;
>
> I have a question about the appearance of Shape3D:
>
> 1) I created an appearance
>
>     //Create a cylinder
>     PolygonAttributes attr = new PolygonAttributes();
>     ap = new Appearance();
>     Material mat = new Material();
>     mat.setLightingEnable(true);
>     ap.setMaterial(mat);
>
> 2) I created a cylinder and assigned that appearance to that cylinder. I
> can see the appearance on the cylinder which is fine.
>     //Create a cylinder
>     Cylinder CylinderObj = new Cylinder(10.0f, 50.0f);
>     CylinderObj.setAppearance(ap);
>     objTrans.addChild(CylinderObj);
>
> 3) I created a box and assigned the same appearance to that box.
> However, I cannot see the appearance on the box. On the scene, the
> cylinder has the appearance but the box doesn't (appears with white
> color). What is wrong?
>
>      // create box1
>      Transform3D transb1 = new Transform3D();
>      transb1.set(new Vector3d(0,0,0));
>      TransformGroup TGTb1 = new TransformGroup(transb1);
>
>      Box box1 = new Box(40.0f, 50.0f, 60.0f);
>      box1.setAppearance(ap);
>      TGTb1.addChild(box1);
>
> Appreciate any help.
>
> Regards
> Murat
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to