hi

There are two shapes in my scene. Both of them are loaded by using
Lw3dLoader class.(They are lws models) user can move,rotate and zoom by
picking on one of them. When two shapes are intersected, I want to write a
message to the screen. I write a code similar the example that is given demo
TickTockCollision, but it is not work.
When
mouseEvents[0] = new WakeupOnCollisionEntry(nesne,
WakeupOnCollisionEntry.USE_BOUNDS);
The canvas3D is seen but it is not work

when
mouseEvents[0] = new WakeupOnCollisionEntry(nesne,
WakeupOnCollisionEntry.USE_GEOMETRY);
The canvas is not seen(all canvas is gray)

"nesne" is a BranchGroup (sahne.getSceneGroup()) or a shape

BranchGroup branch = sahne.getSceneGroup();
   for (Enumeration e = branch.getAllChildren(); e.hasMoreElements(); ) {
     Object obj = e.nextElement();

     if (obj != null && (obj instanceof TransformGroup)) {
       TransformGroup tg = (TransformGroup)obj;
       for (Enumeration ee = tg.getAllChildren();ee.hasMoreElements();) {
         Object newObj = ee.nextElement();

         if (newObj != null && (newObj instanceof Shape3D)) {
           Shape3D shape = (Shape3D) newObj;
           CarpismaYakala cy = new CarpismaYakala(shape);
           cy.setSchedulingBounds(new BoundingSphere(new
Point3d(0.0,0.0,0.0), 100.0));
           anaGrup.addChild(cy);
         }
       }
     }
   }
"CarpimaYakala"

public class CarpismaYakala extends Behavior{
 private WakeupCriterion[] mouseEvents;
 private WakeupOr mouseCriterion;
 private Shape3D nesne;

 public CarpismaYakala(Shape3D nesne){
   System.out.println("constructor");
   this.nesne = nesne;
 }

 public void initialize(){
   mouseEvents = new WakeupCriterion[2];
   mouseEvents[0] = new WakeupOnCollisionEntry(nesne,
WakeupOnCollisionEntry.USE_GEOMETRY);
   mouseEvents[1] = new WakeupOnCollisionExit(nesne,
WakeupOnCollisionExit.USE_GEOMETRY);

   mouseCriterion = new WakeupOr(mouseEvents);
   wakeupOn (mouseCriterion);
 }

 public void processStimulus(Enumeration criteria){
   WakeupCriterion wakeup;
   System.out.println("buradayim");

   while (criteria.hasMoreElements()) {
     wakeup = (WakeupCriterion) criteria.nextElement();

     if (wakeup instanceof WakeupOnCollisionEntry) {
       System.out.println("enter");
     }
     else if (wakeup instanceof WakeupOnCollisionExit){
       System.out.println("exit");
     }
   }
   wakeupOn (mouseCriterion);
 }

}

What is the problem?any help is appreciated..

Nagehan Pala

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

===========================================================================
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".

Reply via email to