I like the sound of this approach, problem is I cant get it to work, anything wrong with the following code: (I just get the whole box rendered with the outside wall texture)
wallAppear = new Appearance(); wallAppear.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_READ); wallAppear.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE); wallAppear.setTransparencyAttributes(new TransparencyAttributes(0, TransparencyAttributes.NICEST)); wallAppear.setPolygonAttributes(poly); Texture tex = new TextureLoader(windowImage, null).getTexture(); wallAppear.setTexture(tex); wallInnerAppear = new Appearance(); wallInnerAppear.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_READ); wallInnerAppear.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE); wallInnerAppear.setTransparencyAttributes(new TransparencyAttributes(0, TransparencyAttributes.NICEST)); wallInnerAppear.setPolygonAttributes(poly); Texture tex2 = new TextureLoader(windowImageInner, null).getTexture(); wallInnerAppear.setTexture(tex2); Box wall = new Box(0.5f, wallHeight, insulation, Box.GENERATE_TEXTURE_COORDS, new Appearance());//wallAppear); wall.setCapability(Box.ENABLE_APPEARANCE_MODIFY); //wall.getShape(wall.TOP).setAppearance(applyText(wallImage)); //wall.getShape(wall.BOTTOM).setAppearance(applyText(wallImage)); //wall.getShape(wall.LEFT).setAppearance(applyText(wallImage)); //wall.getShape(wall.RIGHT).setAppearance(applyText(wallImage)); wall.getShape(wall.FRONT).setAppearance(wallAppear); wall.getShape(wall.BACK).setAppearance(wallInnerAppear); Any thoughts? Thanks >-----Original Message----- >From: Alessandro Borges [mailto:[EMAIL PROTECTED] >Sent: 21 November 2003 19:33 >To: [EMAIL PROTECTED] >Subject: Re: [JAVA3D] Multi Texturing / or Wrapping ?? > >Use 2 texture files. >Create a Appearance for each face. >Apply the appearance for the correct side in a Box >object: > > box01.getShape(Box.Front).setAppearance(app1); > >Do not forget to set the capability bit >ENABLE_APPEARANCE_MODIFY of your box. > >read the javadocs Box, Shape3D, Appearance, etc... > >If the all the side are equals you can use a single appearance >- and a single texture - for all faces. >Preferred texture size: 256x256 pixels. > >Alessandro > > --- Ben Logan <[EMAIL PROTECTED]> escreveu: > Hi, >> This might sound stupid, but I need help texturing a box! >> I want 2 different textures, one on the front and one on the >back, In >> order to simulate a wall, in a house. >> Whats the best way to achieve this, one image file >containing inside + >> outside textures, Or two separate files? How do I implement this, I >> cant find anything in my Java3D book... >> It mentions wrapping, but not the kind that Im talking about! >> >> Thanks in advance for any help >> >> ******************************************** >> Ben Logan - Graduate Software Engineer RCID Stephenson Building >> Newcastle Upon Tyne >> NE1 7RU >> www.rcid.ncl.ac.uk >> ******************************************** >> >> >=============================================================== >============ >> 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". > >Yahoo! Mail - 6MB, anti-spam e antivírus gratuito. Crie sua >conta agora: >http://mail.yahoo.com.br > >=============================================================== >============ >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". > > =========================================================================== 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".