Hi Wayne,
this sounds like you're doing your transformations in the local coordinate
system of the object. If you want to let move things in another coordinate
system, you first have to perform a coord. transformation. for example
tranform your object into the CS of your viewpoint, apply navigation
transforms to it and transform it
back.
You can read more about that in chapter 8 (8.5.1) of Java3D API
Specification.

Gernot
[EMAIL PROTECTED]




                    "wayne c
                    deprince jr."        To:     [EMAIL PROTECTED]
                    <wcd2@lehigh.        cc:
                    edu>                 Subject:     Re: [JAVA3D] help setting 
direction

                    10.12.99
                    16:12
                    Please
                    respond to
                    wcd2






gracia gernot... i tried the attached code and things seem pretty good..
however, when i translate the object in in the +/- x direction it moves
diagonaly.. when i move it right it moves up and right, and left moves
it down and left?  i dont know what a euler angle is, but maybe i was
unclear.. i dont have the angles of rotation yet.. i need to get them..
i only have a directino vector.  is this what setEuler does?  sorry for
the clueless ness.. ciao, wayne


  /**
   * Updates the Tranform3D in the TransformGroup according to the
   * position, direction, normal.  The transform is updated in place.
   * !NOT IMPLEMENTED!
   *
   * @param t the Transform3D to update.
   * @param p The new position.
   * @param d The new direction.
   * @param n The new normal.
   */
  private void _updateTransform(Transform3D t, Point3d p, Vector3d d,
                                Vector3d n)
    {

      // find the point we are looking at.
      //Point3d center = new Point3d();
      //center.sub(p, d);

      //t.lookAt(p, center, new Vector3d(0.0, 0.0, 0.0));
      //return;

      // First apply the position changes.


      // Now set the direction which this should be pointing.
      // We will do the rotations here.
      // Normalize the direction first.
      //d.normalize();
      t.setTranslation(new Vector3d((Tuple3d)p));
      Transform3D rot = new Transform3D();
      rot.setEuler(new Vector3d(d));
      Matrix3d rot_matrix = new Matrix3d();
      rot.get(rot_matrix);
      t.setRotation(rot_matrix);

      return;
}

[EMAIL PROTECTED] wrote:
>
> hi Wayne,
>
> to put an orientation given by a vector to a transform3D, just use
setEuler
> () from Transform3D.
> euler angles describe  angles between a vector an the axis of a
coordinate
> system (if i guess right...)
>
> Gernot
> [EMAIL PROTECTED](See attached file: wcd2.vcf)

wcd2.vcf

Reply via email to