AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Textured Box

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
Rene Tschirley
Guest





PostPosted: Tue Aug 16, 2005 4:35 pm    Post subject: Textured Box Reply with quote



Hi!


Seems that I have been a little too euphoric when I tried to put a
texture onto one surface of a box. The result

http://lava.cs.tu-berlin.de/java/textur_muell.png

is not exactly what I expected to see. It should have been the cube with
this texture

http://lava.cs.tu-berlin.de/java/textur.png

on the front side placed on a blue background. Below is the relevant
part of the source code. I'd be very happy and thankful if anybody of
you could give me a hint and tell me what I did wrong.

Yours,
Rene

---8<---Code---

public class RotationCube extends JPanel {
...
// box erzeugen
Box box = new Box(1.0f, 1.0f, 1.0f, Box.GENERATE_TEXTURE_COORDS |
Box.GENERATE_NORMALS | Box.ENABLE_APPEARANCE_MODIFY, null);

// textur anlegen
Texture2D anteriorTexture = (Texture2D) new
TextureLoader("c:\temp\cube_anterior.png", this).getTexture();
anteriorTexture.setEnable(true);

// textur auf box bringen
Shape3D anteriorShape = box.getShape(Box.FRONT);

Appearance anteriorAppearance = anteriorShape.getAppearance();

anteriorAppearance.setColoringAttributes(new
ColoringAttributes(new Color3f(1,0,0), ColoringAttributes.NICEST));
anteriorAppearance.setTexture(anteriorTexture);

// box in den szenegraphen einbringen
transformGroup.addChild(box);

...
// szenegraphen fertig machen
sceneGraph.compile();
}
---Code--->8---
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.