The lighting is OK because it does affect the surfaces when they are subject to it - the problem is purely that they stay light when the light is gone. I am starting to wonder whether I have some kind of sneaky ambientLight somewhere in my scene that I havent noticed...
I hadn't realized shininess was supposed to be in a range 0-128 - I have always thought it was 0-1 like most of the stuff in J3D - doh! cheers, -ben -----Original Message----- From: N. Vaidya [mailto:[EMAIL PROTECTED] Sent: 09 September 2003 11:15 To: [EMAIL PROTECTED] Subject: Re: [JAVA3D] Simple problem with appearance and textureattributes Hi Ben Assuming that I haven't missed something obvious too, here are some items for you to check on Approach 2: I think your shininess value of 0.2 isn't in the valid range of [1, 128] - Java 3D probably clamps it to 1. Make sure that lighting is enabled on the material, and that your lights are also enabled. Looks like the color of your light - directional is it ? - is probably close to black. Specify the light color as ( 0.7f, 0.7f, 0.7f ) and the Material as default, and see if that would help. Vaidya >On Mon, 8 Sep 2003 16:02:04 +0100, Ben Moxon <[EMAIL PROTECTED]> wrote: >I have a stupid problem here that I just can't remember how to get around. > >I have my code to apply an appearance to a shape3d, like this: > >================================================================================== >Appearance aper = new Appearance(); >Color3f Black = new Color3f(0f, 0f, 0f); >Color3f White = new Color3f(1.0f, 1.0f, 1.0f); > javax.media.j3d.Material Mser = new javax.media.j3d.Material(White, Black, White, White, 0.2f); >aper.setMaterial(Mser); >TextureAttributes texatt=new TextureAttributes(TextureAttributes.BLEND, new Transform3D(), new Color4f(1f, 1f, 1f, 1f), TextureAttributes.NICEST); >aper.setTextureAttributes(texatt); >this.setAppearance(aper); >=================================================================================== > >Nothing wrong there, except that when my scene is unlit, the shape is still visible. After asking around I figured that it may be the fact I am using BLEND and perhaps the ambient colour settings that are causing this, so I change it around: > >================================================================================== >Appearance aper = new Appearance(); >Color3f Black = new Color3f(0f, 0f, 0f); >Color3f White = new Color3f(1.0f, 1.0f, 1.0f); > javax.media.j3d.Material Mser = new javax.media.j3d.Material(Black, Black, White, White, 0.2f); >aper.setMaterial(Mser); >TextureAttributes texatt=new TextureAttributes(TextureAttributes.MODULATE, new Transform3D(), new Color4f(1f, 1f, 1f, 1f), TextureAttributes.NICEST); >aper.setTextureAttributes(texatt); >this.setAppearance(aper); >=================================================================================== > >But now my shape looks black - it is still reflecting the lights but it is reflecting them as a plain black surface with no visible texture. > >I tried adjusting the texture blend colour and the ambient colour of the Material but none of it seems to be making any difference. I know the lights are in bounds because they are affecting other objects in the scene. > >I'm sure I'm missing something obvious, but I just can't see what! > >-ben > >Ben Moxon >newview* > >t: 01483 685 398 >e: [EMAIL PROTECTED] >w:http://www.newview.co.uk/ >********************************************************************************* >This email, its content and any files transmitted with it are intended >solely for the addressee(s) and may be legally privileged and/or >confidential. If you are not the intended recipient please delete and >contact the sender via email return. Unless expressly stated otherwise, >and subject to the disclaimer below, this email does not form part of a >legally binding contract or agreement between the recipient and >Newview Communications Limited. >Messages sent via this medium may be subject to delays, non-delivery >and unauthorised alteration. This email has been prepared using >information believed by the author to be reliable and accurate, but >Newview Communications Limited makes no warranty as to accuracy or completeness. >In particular, Newview Communications Limited does not accept >responsibility for changes made to this email after it was sent. >Any opinions or recommendations expressed herein are solely those >of the author. They may be subject to change without notice. >********************************************************************************* > >=========================================================================== >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". =========================================================================== 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".