Example usage for javax.media.j3d Transform3D Transform3D

List of usage examples for javax.media.j3d Transform3D Transform3D

Introduction

In this page you can find the example usage for javax.media.j3d Transform3D Transform3D.

Prototype

public Transform3D(Matrix3f m1, Vector3f t1, float s) 

Source Link

Document

Constructs and initializes a transform from the rotation matrix, translation, and scale values.

Usage

From source file:pl.edu.icm.visnow.geometries.viewer3d.Display3DPanel.java

private void rescaleFromMouseWheel(java.awt.event.MouseWheelEvent evt) {
    if (lockView) {
        return;/*from  w  ww  .  ja  va 2s  . c  o  m*/
    }

    int notches = evt.getWheelRotation();
    if (notches < 0) {
        mouseScale /= mouseWheelSensitivity;
    } else {
        mouseScale *= mouseWheelSensitivity;
    }
    tempTransform = new Transform3D(new Matrix3d(1., 0., 0., 0., 1., 0., 0., 0., 1.),
            //sceneCenter,
            new Vector3d(0.0, 0.0, 0.0), externScale * mouseScale);
    objScale.setTransform(tempTransform);
}

From source file:pl.edu.icm.visnow.geometries.viewer3d.Display3DPanel.java

@Override
public void setScale(double scale) {
    if (lockView)
        return;/* ww  w  . j  a  v  a 2s  . c o  m*/

    externScale = scale;
    tempTransform = new Transform3D(new Matrix3d(1., 0., 0., 0., 1., 0., 0., 0., 1.),
            // sceneCenter,
            new Vector3d(0.0, 0.0, 0.0), externScale * mouseScale);
    objScale.setTransform(tempTransform);
}