Well, I went ahead and implemented a scale interpolator that does
what I want, so here is the code in case anyone else would like to use something 
similar.  Feel free to offer any suggestions.


Jason





import java.util.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class VectorScaleInterpolator extends Interpolator {


    public static int X = 1;
    public static int Y = 2;
    public static int Z = 3;
    protected double m_min;
    protected double m_max;
    protected int m_vector;
    protected TransformGroup m_tg;
    protected WakeupOnElapsedFrames wf
       = new WakeupOnElapsedFrames(1);
    protected Transform3D t3d = new Transform3D();
    protected Vector3d v3d = new Vector3d();
    public void initialize() {

        wakeupOn( wf );
    }

    public void processStimulus( Enumeration enum ) {

        double val = getAlpha().value();
double newScale = m_min + val*(m_max-m_min);
   m_tg.getTransform(t3d);
        t3d.getScale(v3d);
if(m_vector == X)
{
   v3d.x = newScale;

}
else if(m_vector == Y)
{
   v3d.y = newScale;
}
else if(m_vector == Z)
{
   v3d.z = newScale;
}
   t3d.setScale(v3d);
m_tg.setTransform(t3d);

        wakeupOn( wf );
    }

    public VectorScaleInterpolator( Alpha alpha, TransformGroup tg,
int vector, double max, double min) {

        super( alpha );
m_tg  = tg;
if(vector == X)
{
   m_vector = vector;
}
else if(vector == Y)
{
   m_vector = vector;
}
else if(vector == Z)
{
   m_vector = vector;
}
else
{
   m_vector = X;
}
m_min = min;
m_max = max;
    }
}

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