Well, I finally tracked down the problem. I was setting the Transparency attributes like this:
//should be opaque ta.setTransparency(0.0f); ta.setTransparencyMode(TransparencyAttributes.NICEST); a.setTransparencyAttributes(ta); However, that still leaves transparency enabled...I'm assuming that plugging 0.0f into the transparency equation as the alpha != 0. To fix, either leave the TransparencyAttributes on the Appearance null or ta.setTransparencyMode(TransparencyAttributes.NONE); Anyway, it wasn't a surface normal problem after all. kddubb On Mon, 2004-02-23 at 15:50, Kevin wrote: > All, > > I am a newbie working on a fairly simple Java3D application that > virtually models networked computer systems. I have a quick question on > surface normals and how they work in the Java3D framework. But first, > here is my (limited) understanding of what surface normals are from the > standard Java3D tutorials, etc so you can correct it if necessary. > > Surface normals to me seem to be analogous to the angle of reflection > for shading purposes in the virtual world. Java3D uses this angle of > reflection most (visually) by the specular color and shininess > attributes, but should also be used for determining information for > diffuse and ambient color. > > Problem Background: > > Most of my objects in my environment are boxes of different dimensions. > These boxes could be resized at any moment in the application for a > multitude of reasons. Because of this interaction the Box primitive > wasn't very conducive and I decided to create my own Shape3D extension > that knows how to resize itself in real-time according to my > parameters. > > The Problems: > > Now when I use CassattItem3D objects, they render mostly correct except > that many faces seem partially transparent (I think as a function of > their surface normals). I don't think that was very clear, so I'll > state it a different way. The boxes seem to render the correct > specular, diffuse, ambient colors, but the part of the geometry that > should be blocked (i.e. the back bottom faces) seem to still affect the > shading on the front faces. The object has an opaque > transparency/appearance attribute. > > I also have these objects as a part of a TransformGroup with a mouse > rotator attached so I can view them from different perspectives. As the > objects rotate, faces seem to keep their specular, diffuse, ambient > colors. The light is not in the TransformGroup so it should be > independent of the rotation. > > My questions: > > 1) Why are the front surfaces appear to be affected by the surface > normals of the back surfaces > 2) When I rotate the objects, the faces seem to keep their initial > specular, diffuse, emissive, and ambient colors even though I am > rotating them independently of the light source. Why don't the colors > change in relation to the light source after they are rendered? > > Anyway, I hope my questions made sense and I didn't show my stupidity > too blatantly. I'm attaching the code with the implementation of the > Box so you can correct, flame, etc. about my implementation. Sorry for > the messy code, but it has a day and half of trial and error programming > trying to test interactions out. > > thanks in advance for the help...any pointers to tutorials/FAQs on using > surface normals appreciated. > > kddubb > > =========================================================================== > 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".