Examples of Alpha


Examples of de.lessvoid.nifty.tools.Alpha

    if ((areaProviderProperty != null) || (renderStrategyProperty != null)) {
      image.setImageMode(ImageModeFactory.getSharedInstance().createImageMode(areaProviderProperty,
          renderStrategyProperty));
    }

    alpha = new Alpha(parameter.getProperty("alpha", "#f"));
    inset = new SizeValue(parameter.getProperty("inset", "0px"));
    width = new SizeValue(parameter.getProperty("width", element.getWidth() + "px"));
    height = new SizeValue(parameter.getProperty("height", element.getHeight() + "px"));
    center = Boolean.valueOf(parameter.getProperty("center", "false"));
    hideIfNotEnoughSpace = Boolean.valueOf(parameter.getProperty("hideIfNotEnoughSpace", "false"));
View Full Code Here

Examples of de.lessvoid.nifty.tools.Alpha

  public void activate(final Nifty nifty, final Element element, final EffectProperties parameter) {
    // startColor and endColor (only alpha component used) are the old version of this
    // and are kept here only for backward compatibility. The current attributes are "start" and "end" alpha values.
    if (parameter.getProperty("startColor") != null) {
      start = new Alpha(new Color(parameter.getProperty("startColor", "#000000ff")).getAlpha());
    }
    if (parameter.getProperty("endColor") != null) {
      end = new Alpha(new Color(parameter.getProperty("endColor", "#ffffffff")).getAlpha());
    }
    if (parameter.getProperty("start") != null) {
      start = new Alpha(parameter.getProperty("start"));
    }
    if (parameter.getProperty("end") != null) {
      end = new Alpha(parameter.getProperty("end"));
    }
    interpolator = parameter.getInterpolator();
  }
View Full Code Here

Examples of de.lessvoid.nifty.tools.Alpha

      final Falloff falloff,
      final NiftyRenderEngine r) {
    if (interpolator != null) {
      r.setColorAlpha(interpolator.getValue(normalizedTime));
    } else {
      Alpha a = start.linear(end, normalizedTime);
      r.setColorAlpha(a.getAlpha());
    }
  }
View Full Code Here

Examples of javax.media.j3d.Alpha

            pos++;
        }
       
        setUserData(entity);

        alpha = new Alpha(1, 500*movePath.size());
        KBRotPosScaleSplinePathInterpolator interpolator1 =
            new KBRotPosScaleSplinePathInterpolator(alpha, facing, new Transform3D(), keyframes1) {
                @Override
                public void computeTransform(float alphaValue, Transform3D transform) {
                    super.computeTransform(alphaValue, transform);
View Full Code Here

Examples of javax.media.j3d.Alpha

    TransformGroup tgmCyl = new TransformGroup();
    tgmCyl.addChild(tgCylinder);

    //The movement from left to right.
    Transform3D escape = new Transform3D();
    Alpha cylAlphaR = new Alpha(1,2000);

    //The starting time is first postponed until "infinity".
    cylAlphaR.setStartTime(Long.MAX_VALUE);

    //The interpolator for the movement.
    float maxRight = 0.5f;
    PositionInterpolator cylMoveR = new PositionInterpolator(cylAlphaR,tgmCyl,
                                                             escape,0.0f,maxRight);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
    cylMoveR.setSchedulingBounds(bounds);


    //The same for the movement from right to left.
    Alpha cylAlphaL = new Alpha(1,2000);
    cylAlphaL.setStartTime(Long.MAX_VALUE);

    PositionInterpolator cylMoveL = new PositionInterpolator(cylAlphaL,tgmCyl,
                                                             escape,maxRight,0.0f);

    cylMoveL.setSchedulingBounds(bounds);
View Full Code Here

Examples of javax.media.j3d.Alpha

    Transform3D rotationAxis = new Transform3D();


    //The following lines define what the cube should do when picked.
    Alpha boxAlpha = new Alpha(1,2000);

    //The starting time is first postponed until "infinity".
    boxAlpha.setStartTime(Long.MAX_VALUE);

    RotationInterpolator boxRotation = new RotationInterpolator(boxAlpha,tgmBox,
                                             rotationAxis,0.0f,(float) Math.PI*2);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
    boxRotation.setSchedulingBounds(bounds);

    //The movement is added to the transformation group.
    tgmBox.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBox.addChild(boxRotation);


    //A transformation group for positioning the cube.
    Transform3D tfFBox = new Transform3D();
    tfFBox.rotY(Math.PI/6);
    Transform3D rotationX = new Transform3D();
    rotationX.rotX(-Math.PI/5);
    tfFBox.mul(rotationX);
    TransformGroup tgFBox = new TransformGroup(tfFBox);
    tgFBox.addChild(tgmBox);


//*** The same for the sphere.
    Color3f ambientColourBSphere = new Color3f(0.0f,0.6f,0.0f);
    Color3f emissiveColourBSphere = new Color3f(0.0f,0.0f,0.0f);
    Color3f diffuseColourBSphere = new Color3f(0.0f,0.6f,0.0f);
    Color3f specularColourBSphere = new Color3f(0.0f,0.6f,0.0f);
    float shininessBSphere = 2.0f;

    Appearance bSphereApp = new Appearance();

    bSphereApp.setMaterial(new Material(ambientColourBSphere,
                                        emissiveColourBSphere,
                                        diffuseColourBSphere,
                                        specularColourBSphere,
                                        shininessBSphere));

    Sphere bSphere = new Sphere(0.4f,bSphereApp);

    //The UserData are needed in order to identify the sphere when it is picked.
    bSphere.setUserData("sphere");

    TransformGroup tgmBSphere = new TransformGroup();
    tgmBSphere.addChild(bSphere);


    //Two transformations must be defined for the sphere: One for
    //shrinking, one for growing. First the shrinking transformation
    //is defined.
    Alpha sphereShrinkAlpha = new Alpha(1,2000);

    //The starting time is first postponed until "infinity".
    sphereShrinkAlpha.setStartTime(Long.MAX_VALUE);

    ScaleInterpolator shrinker = new ScaleInterpolator(sphereShrinkAlpha,
                                                       tgmBSphere,
                                                       new Transform3D(),
                                                       1.0f,0.5f);

    shrinker.setSchedulingBounds(bounds);

    tgmBSphere.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBSphere.addChild(shrinker);


    //The same for the growing sphere.
    Alpha sphereStretchAlpha = new Alpha(1,2000);
    sphereStretchAlpha.setStartTime(Long.MAX_VALUE);

    ScaleInterpolator stretcher = new ScaleInterpolator(sphereStretchAlpha,
                                                       tgmBSphere,
                                                       new Transform3D(),
                                                       0.5f,1.0f);
View Full Code Here

Examples of javax.media.j3d.Alpha

    //The transformation group for the directional light including the rotation.
    TransformGroup tfmLight = new TransformGroup();
    tfmLight.addChild(light);

    //The Alpha for the rotation.
    Alpha alphaLight = new Alpha(-1,4000);
    //The rotation.
    RotationInterpolator rot = new RotationInterpolator(alphaLight,tfmLight,
                                                        new Transform3D(),
                                                         0.0f,(float) Math.PI*2);
    rot.setSchedulingBounds(bounds);
View Full Code Here

Examples of javax.media.j3d.Alpha

    tgmBox.addChild(fBox);

    //Define the rotation.
    Transform3D rotationAxis = new Transform3D();

    Alpha boxAlpha = new Alpha(1,2000);

    //Set the starting time of the rotation to infinity.
    boxAlpha.setStartTime(Long.MAX_VALUE);

    RotationInterpolator boxRotation = new RotationInterpolator(boxAlpha,tgmBox,
                                             rotationAxis,0.0f,(float) Math.PI*2);

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),100.0);
    boxRotation.setSchedulingBounds(bounds);

    //Add the rotation to the corresponding transform group.
    tgmBox.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBox.addChild(boxRotation);


    //Create a transformgroup for the positioning of the box and add the
    //transformgroup with the rotation.
    Transform3D tfFBox = new Transform3D();
    tfFBox.rotY(Math.PI/6);
    Transform3D rotationX = new Transform3D();
    rotationX.rotX(-Math.PI/5);
    tfFBox.mul(rotationX);
    TransformGroup tgFBox = new TransformGroup(tfFBox);

    tgFBox.addChild(tgmBox);


    //The same for the sphere:
    Color3f ambientColourBSphere = new Color3f(0.0f,0.0f,0.0f);
    Color3f emissiveColourBSphere = new Color3f(0.0f,0.0f,0.0f);
    Color3f diffuseColourBSphere = new Color3f(0.0f,0.5f,0.0f);
    Color3f specularColourBSphere = new Color3f(0.0f,0.8f,0.0f);
    float shininessBSphere = 128.0f;

    Appearance bSphereApp = new Appearance();

    bSphereApp.setMaterial(new Material(ambientColourBSphere,
                                        emissiveColourBSphere,
                                        diffuseColourBSphere,
                                        specularColourBSphere,
                                        shininessBSphere));

    Sphere bSphere = new Sphere(0.4f,bSphereApp);

    bSphere.setUserData("sphere");

    TransformGroup tgmBSphere = new TransformGroup();
    tgmBSphere.addChild(bSphere);


    //Create the transformation for shrinking.
    Alpha sphereShrinkAlpha = new Alpha(1,2000);
    sphereShrinkAlpha.setStartTime(Long.MAX_VALUE);

    ScaleInterpolator shrinker = new ScaleInterpolator(sphereShrinkAlpha,
                                                       tgmBSphere,
                                                       new Transform3D(),
                                                       1.0f,0.5f);

    shrinker.setSchedulingBounds(bounds);



    tgmBSphere.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmBSphere.addChild(shrinker);


    //Create the transformation for stretching the sphere again.
    Alpha sphereStretchAlpha = new Alpha(1,2000);
    sphereStretchAlpha.setStartTime(Long.MAX_VALUE);

    ScaleInterpolator stretcher = new ScaleInterpolator(sphereStretchAlpha,
                                                       tgmBSphere,
                                                       new Transform3D(),
                                                       0.5f,1.0f);
View Full Code Here

Examples of javax.media.j3d.Alpha

    //The transformation group for the spotlight and its rotation.
    TransformGroup tfmLight = new TransformGroup();
    tfmLight.addChild(lightSpot);

    //The Alpha for the rotation.
    Alpha alphaLight = new Alpha(-1,4000);
    //The rotation
    RotationInterpolator rot = new RotationInterpolator(alphaLight,tfmLight,
                                                        new Transform3D(),
                                                         0.0f,(float) Math.PI*2);
    rot.setSchedulingBounds(bounds);
View Full Code Here

Examples of javax.media.j3d.Alpha

    tgmBird.addChild(body);


    //The bird's flight.
    long flightTime = 10000;
    Alpha flightAlpha = new Alpha(-1,Alpha.INCREASING_ENABLE+Alpha.DECREASING_ENABLE,
                                  0,0,flightTime,0,0,flightTime,0,0);

    float flightDistance = 9.0f;
    PositionInterpolator posIFlight = new PositionInterpolator(flightAlpha,
                                                   tgmBird,new Transform3D(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.