I use a Box from Java3D - and adds textures to it - but for some reason
when I view it from different angles - it shows up like this -->
http://www.vejle-taekwondo.dk/error_in_3d.bmp
The image should display a nice clean image - but it shows black triangles
on the side of the box
can anyone explain what the reason is for that behavior ?
and what is the solution ?
Appearance boxAppear = new Appearance();
Appearance topAppear = new Appearance();
Appearance frontAppear = new Appearance();
Appearance backAppear = new Appearance();
topAppear.setMaterial(new Material(new Color3f(0.0f, 0.0f, 0.0
f), new Color3f(0.0f, 0.0f, 0.0f), new Color3f(0.0f, 0.0f, 0.0f), new
Color3f(0.0f, 0.0f, 0.0f), 100.0f));
boxAppear.setMaterial(new Material(new Color3f(0.1f, 0.1f, 0.4
f), new Color3f(0.1f, 0.1f, 0.1f), new Color3f(0.1f, 0.1f, 0.1f), new
Color3f(0.4f, 0.4f, 0.1f), 3.0f));
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(0.0f, 0.0f, 0f);
boxAppear.setColoringAttributes(ca);
PolygonAttributes pa = new PolygonAttributes();
boxAppear.setPolygonAttributes(pa);
Box tmpBox = new Box(0.314f, 1.178f, 0.528f,
Primitive.GENERATE_TEXTURE_COORDS, boxAppear);
TextureLoader loader = new
TextureLoader(floor.getImage(imgIdTop), floor);
Texture2D texture = new Texture2D();
texture.setEnable(true);
topAppear.setTexture(loader.getTexture());
loader = new TextureLoader(floor.getImage(imgIdFront), floor);
frontAppear.setTexture(loader.getTexture());
loader = new TextureLoader(floor.getImage(imgIdBack), floor);
backAppear.setTexture(loader.getTexture());
tmpBox.setAppearance(1, backAppear);
tmpBox.setAppearance(2, boxAppear);
tmpBox.setAppearance(3, boxAppear);
// enable to add Appearance to the top!!!
//tmpBox.setAppearance(4, topAppear);
//tmpBox.setAppearance(5, topAppear);
tmpBox.setAppearance(0, frontAppear);
Mikkel Andersen, ISX BOT Team
APC Denmark
http://www.apc.com
===========================================================================
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".