You should calculate delay time each 1 interpolator, so i get delay time for next alpha value.
From: "A. Murat Tanyer" <[EMAIL PROTECTED]> Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [JAVA3D] advice needed about animation Date: Tue, 28 Jan 2003 12:15:23 +0000 Dear all, I am trying to make an animation of my scene. Basically, the objects should go from transparent to opaque. The duration of animation for each object should be assigned during the run time by the user. That means that the user selects objects during the run time and assigns a 't' duration to them. 't' could be different for each selection group. Within the assigned 't' duration, the objects should go from transparent to opaque. My scenegraph is attached. For each object I created I added a TransparencyInterpolator with a default Alpha. During the run time I create a new Alpha with the 't' duration and replace the previous alpha with this new one which has the correct duration information. The problem is I can't get my objects animated. My questions are: i) Is this possible to replace an alpha value of a TransparencyInterpolator with a new one during the run time? ii) Is my logic correct for this animation? iii) How can I start and stop the activity of a TransparencyInterpolator during the run time? Thanks for any help // MY CODE Vector v_linked_elements = new Vector(); //LOOP FOR EACH ELEMENT { BranchGroup cT = new BranchGroup(); TransparencyAttributes objTransp = new TransparencyAttributes(); objTransp.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE); objTransp.setTransparencyMode(TransparencyAttributes.BLENDED); objTransp.setTransparency(1.0f); Appearance app2 = part2.getAppearance(); app2.setTransparencyAttributes(objTransp); part2.setAppearance(app2); part2.setPickable(false); //CREATE AN ALPHA VALUE FOR THE TRANSPARENCYINTERPOLATOR Alpha alpha = new Alpha(); //CREATE A TRANSPARENCYINTERPOLATOR TransparencyInterpolator traInt = new TransparencyInterpolator (alpha, objTransp); traInt.setSchedulingBounds(Scenegraph.bounds); //ADD TRANSPARENCYINTERPOLATOR TO THE SCENEGRAPH cT.addChild(traInt); //PUT EACH TRANSPARENCYINTERPOLATOR INTO A VECTOR v_linked_elements.add(traInt); .... } //END LOOP FOR EACH ELEMENT //DURING THE RUN TIME CREATE A NEW ALPHA AND ASSIGN TO THE SELECTED OBJECTS' TRANSPARENCYINTERPOL. Alpha alp_dur = new Alpha(); alp_dur.setLoopCount(-1); alp_dur.setMode(Alpha.DECREASING_ENABLE); alp_dur.setTriggerTime(0); alp_dur.setPhaseDelayDuration(delay*2000); alp_dur.setIncreasingAlphaDuration(0); alp_dur.setDecreasingAlphaDuration((long)duration * 5000); alp_dur.setAlphaAtZeroDuration(0); //ASSIGN NEW ALPHA INSTEAD OF THE PREVIOUS ALPHAS THAT ARE IN THE VECTOR for(int i=0; i < v_linked_elements.size(); i++) ((TransparencyInterpolator)(v_linked_elements_TI.get(i))).setAlpha(alp_dur); << Bg.jpg >>
_________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus =========================================================================== 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".