Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java3D TransparencyAttributes

  Asked By: Aditi    Date: Sep 28    Category: Java    Views: 724
  

I tried to create an object of TransparencyAttributes, but gets this
error:

stuf/test3d/test3d2.java [40:1] cannot resolve symbol
symbol : constructor TransparencyAttributes (int,double,int,int)
location: class javax.media.j3d.TransparencyAttributes
TransparencyAttributes attr = new TransparencyAttributes
(TransparencyAttributes.BLENDED, 0.5,
TransparencyAttributes.BLEND_SRC_ALPHA,
TransparencyAttributes.BLEND_ONE);

Is it a bug?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Kawthar Malik     Answered On: Sep 28

The constructor  for TransaprencyAttributes is (int, float, int, int).
When you use 0.5, the compiler makes it a double  by default and
searches for a constructor of (int, double, int, int). Use 0.5f to
create a variable of type float.

 
Didn't find what you were looking for? Find more on Java3D TransparencyAttributes Or get search suggestion and latest updates.