|
Two hings to consider:
1. Your blending is currently setting them to
compltely opaque. Of course you could be using vertex colors with alphas,
so I am not sure. But if you are depending on the transparency attributes
then you should set this to something less than 1.
2. The lowest granularity of transparency sorting
in Java3d is the geometry array. So if you are putting all your geometry
into one array then it will not be sorted.
3. If you are overriding the bounds on the objects
such that all the bounds are the same then there will be no effective
sorting.
----- Original Message -----
Sent: Thursday, July 10, 2003 6:38
AM
Subject: Re: [JAVA3D] Help with
transparent textures please :)
Jeremy Booth wrote:
>
View.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY) > >
plateAppearance = new
Appearance(); >
transparencyAttributes =
new >
TransparencyAttributes(TransparencyAttributes.BLENDED,
1.0f); > >
TextureAttributes texAttr = new
TextureAttributes(); >
texAttr.setTextureMode(TextureAttributes.REPLACE); > >
texAttr.setPerspectiveCorrectionMode(TextureAttributes.FASTEST); > >
plateAppearance.setTexture(texture); > >
RenderingAttributes plateRenderingAttributes = new >
RenderingAttributes(); >
plateRenderingAttributes.setIgnoreVertexColors(true); > >
Material plateMaterial = new
Material(); >
plateMaterial.setLightingEnable(false); >
plateAppearance.setMaterial(plateMaterial); > > >
plateAppearance.setRenderingAttributes(plateRenderingAttributes); >
plateAppearance.setTextureAttributes(texAttr); >
plateAppearance.setTransparencyAttributes( > transparencyAttributes
); > >
plateShape.setAppearance(plateAppearance); > > >
HTH > > Jeremy
Thanks for the help but still no
result. PS it is frustrating because transparency is SO POORLY
documented
Here is the code implemented in
jython
def
Main(self):
.....
>
view = univ.getViewer().getView() > >
view.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY)
>>
def
buildAppearance(self): >> >>
plateAppearance =
Appearance() >> >>
plateTransAttrs = >>
TransparencyAttributes(TransparencyAttributes.BLENDED,
1.0) >> >>
plateTexAttr =
TextureAttributes() >>
plateTexAttr.setTextureMode(TextureAttributes.REPLACE) >> >>
plateTexAttr.setPerspectiveCorrectionMode(TextureAttributes.NICEST) >> >>
plateTexture = TextureLoader('mask5.png', >>
JFrame()).getTexture() >> >>
plateRendAttrs =
RenderingAttributes() >>
plateRendAttrs.setIgnoreVertexColors(1) >> >>
plateMaterial =
Material() >>
plateMaterial.setLightingEnable(0) >> >>
platePolygon =
PolygonAttributes() >>
platePolygon.setCullFace(PolygonAttributes.CULL_NONE) >>
platePolygon.setBackFaceNormalFlip(1) >> >>
plateAppearance.setTextureAttributes(plateTexAttr) >>
plateAppearance.setTransparencyAttributes( >> plateTransAttrs
) >>
plateAppearance.setMaterial(plateMaterial); >>
plateAppearance.setPolygonAttributes(platePolygon) >>
plateAppearance.setRenderingAttributes(plateRendAttrs) >>
plateAppearance.setTexture(plateTexture) >> >>
return plateAppearance > > Background.
I am on a linux
machine. I am using SimpleUniverse and orbitBehavior, -> camera moves
not object. The program requires a set of 3D coordinates and vector weights
as input. A set of 3D polygon blob like objects are created showing areas
within the molecule that do not like water (hydrophobic patchs) I was
not keen on using j3d but the boys upstairs made me. I am pretty much
finished with the prototype; the transparency issue is all that is
left. Do I have to build up my geometry in a special way ? What else can
I do ?
Thanks for your
help,
Chris
=========================================================================== 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".
|