Michael Lees wrote:
Hello Michael,
[change object transparency]
> public sim.portrayal3d.simple.CubePortrayal3D representation;
> representation = new sim.portrayal3d.simple.CubePortrayal3D(colour,size)
Looks good.
> And then attempt to change the transparency by...
>
> representation.appearance.getTransparencyAttributes().setTransparency(1.0f);
Where exactly are you calling this from?
I remember having some problems with changing the color of objects at
runtime as well and if I recall correctly the problem is the origin of
the call.
iirc you should call the above from the accompanying
javax.media.j3d.Behavior of your Portrayal3D. Basically you make the
call to changing your transparency from the processStimulus method in
that class. External objects can't change the properties of a Java3D
object.
I wrote my own 3D portrayal at the time, so it might be different when
using the more standard components. Maybe someone else can confirm the
above and if correct you should find the solution in a Jva3D tutorial.
I don't have a code example handy right now, sorry.
Greetings,
Bruno
--
Bruno Van Den Bossche
[log in to unmask]
http://www.ibcn.intec.UGent.be
|