Examples of Cylinder


Examples of com.sun.j3d.utils.geometry.Cylinder

    //Height of the tree trunk.
    float trunkHeight = 0.4f;

    //Generate the tree trunk as a cylinder.
    Cylinder trunk = new Cylinder(0.05f,trunkHeight,brownApp);

    //The transformation group of the tree trunk. The tree trunk first
    //remains in the origin and is placed in the scene together with the
    //leaves.
    TransformGroup tgTrunk = new TransformGroup();
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

        if (_shouldShowAxes()) {
            Sphere origin = new Sphere((float) 0.05);
            _userTransformation.addChild(origin);

            Cylinder yAxis = new Cylinder((float) 0.01, (float) 6.0);
            _userTransformation.addChild(yAxis);

            Cylinder xAxis = new Cylinder((float) 0.01, (float) 6.0);
            Transform3D rotation = new Transform3D();
            Quat4d quat = new Quat4d();
            quat.set(new AxisAngle4d(0.0, 0.0, 1.0, Math.PI / 2.0));
            rotation.set(quat);

            TransformGroup xAxisGroup = new TransformGroup(rotation);
            xAxisGroup.addChild(xAxis);
            _userTransformation.addChild(xAxisGroup);

            Cylinder zAxis = new Cylinder((float) 0.01, (float) 6.0);
            Transform3D rotation2 = new Transform3D();
            Quat4d quat2 = new Quat4d();
            quat2.set(new AxisAngle4d(1.0, 0.0, 0.0, Math.PI / 2.0));
            rotation2.set(quat2);
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

                .intValue();
        int sideDivisionsValue = ((IntToken) sideDivisions.getToken())
                .intValue();

        if (allowChanges) {
            Cylinder cylinder = new Cylinder(1.0f, 1.0f, primitiveFlags,
                    circleDivisionsValue, sideDivisionsValue, _appearance);

            TransformGroup scaler = new TransformGroup();
            scaler.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            _scaleTransform = new Transform3D();
            _scaleTransform.setScale(new Vector3d(radiusValue, heightValue,
                    radiusValue));
            scaler.setTransform(_scaleTransform);
            scaler.addChild(cylinder);
            _containedNode = scaler;
        } else {
            _containedNode = new Cylinder(radiusValue, heightValue,
                    primitiveFlags, circleDivisionsValue, sideDivisionsValue,
                    _appearance);
            _scaleTransform = null;
        }
    }
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

            throw new IllegalArgumentException("Null tree trunk 3D state");
        }
        Appearance trunkAppearance = new Appearance();
        AppearanceFactory.setColorWithMaterial(trunkAppearance, ColorConstants.brown, new Color3f(0.15f, 0.15f, 0.15f),
                new Color3f(0.05f, 0.05f, 0.05f));
        trunkCylinder = new Cylinder(trunk.getRadius(), trunk.getHeight(), trunkAppearance);
        Vector3d translationVector = new Vector3d();
        translationVector.setY(trunk.getHeight() / 2);
        TransformGroup transformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
        transformGroup.addChild(trunkCylinder);
        this.group = new Group();
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

    final Appearance redLook = new Appearance();
    redLook.setMaterial(redMaterial);
    final Appearance yellowLook = new Appearance();
    yellowLook.setMaterial(yellowMaterial);
   
     final Cylinder cylinder = new Cylinder(1, 1,
         Cylinder.GENERATE_NORMALS |
         Cylinder.ENABLE_GEOMETRY_PICKING,
         26, 26, lightGrayLook);
        final Sphere sphere = new Sphere(10,
            Sphere.GENERATE_NORMALS |
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

   
    Appearance ap = Java3DUtils.createDefaultAppearance();
     
    //Create a cylinder

    Cylinder CylinderObj = new Cylinder(0.5f, 2.2f, ap);//radius, height
    objRot.addChild(CylinderObj);
   
    //chris
  Transform3D t = new Transform3D();
  t.set(0.3, new Vector3d(0.5, 0.5, 0.0));
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

/* 109 */     super.buildGraph();
/*     */   }
/*     */
/*     */   public SceneGraphObject createNode(Class j3dClass)
/*     */   {
/* 115 */     Cylinder cylinder = (Cylinder)createNode(j3dClass, new Class[] { Float.TYPE, Float.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, Appearance.class }, new Object[] { new Float(this.radius), new Float(this.height), new Integer(this.primflags), new Integer(this.xdivision), new Integer(this.ydivision), null });
/*     */
/* 130 */     return cylinder;
/*     */   }
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

/*     */
/* 130 */     return cylinder;
/*     */   }
/*     */
/*     */   protected SceneGraphObject createNode() {
/* 134 */     return new Cylinder(this.radius, this.height, this.primflags, this.xdivision, this.ydivision, null);
/*     */   }
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

    Vector3f v1bs0 = new Vector3f(0f,-10f,1f);
    tr1bs01.set(v1bs0);
    tr1bs0.rotX(Math.PI/2);
    tr1bs0.mul(tr1bs01);
    TransformGroup tg1bs0 = new TransformGroup(tr1bs0);
    tg1bs0.addChild(new Cylinder(5f,10f,appObs));
   
    base.addChild(tg1bs0)// obstacol cylinder;
   
   
   
View Full Code Here

Examples of com.sun.j3d.utils.geometry.Cylinder

    trCyl1.set(new Vector3f(0.f,0.8f,0f));
    Transform3D trCyl1rot = new Transform3D();
    trCyl1rot.rotX(90*Math.PI/180);
    trCyl1.mul(trCyl1rot);
    TransformGroup trGcyl1 = new TransformGroup(trCyl1);
    Cylinder cyl1 = new Cylinder(0.2f,0.5f,appCyl);
    trGcyl1.addChild(cyl1);
   
    // Cylinder 2
    Transform3D trCyl2 = new Transform3D();
    trCyl2.set(new Vector3f(0f,0.5f,0f));
    Transform3D trCyl2rot = new Transform3D();
    trCyl2rot.rotZ(90*Math.PI/180);
    trCyl2.mul(trCyl2rot);
    TransformGroup trGcyl2 = new TransformGroup(trCyl2);
    Cylinder cyl2 = new Cylinder(0.2f,0.5f,appCyl);
    trGcyl2.addChild(cyl2);
   
   
    // box1
    Transform3D tr1 = new Transform3D();
   
        Transform3D trRot2 = new Transform3D()
    trRot2.rotX(rot2*Math.PI/180);
    tr1.mul(trRot2);
   
    Transform3D tr11 = new Transform3D();
    tr11.set(new Vector3f(0f,-0.5f,0f));
    tr1.mul(tr11);
   
   
    //tr1.set(new Vector3f(0f,-0.5f,0f));
    TransformGroup trGbox1 = new TransformGroup(tr1);
    Box box1 = new Box(0.2f,1f,0.2f,app);
    trGbox1.addChild(box1);
   
   
    Transform3D tr2 = new Transform3D();
    tr2.set(new Vector3f(0f,-0.5f,0.3f));
    tr1.mul(tr2);
   
    Transform3D tr3 = new Transform3D();
    //tr3.rotX(30*Math.PI/180);
    tr3.rotX(rot3*Math.PI/180);

    // Cylinder 3
    Transform3D trCyl3 = new Transform3D();
    //trCyl3.set(new Vector3f(0f,-1.5f,0f));
   
                            Transform3D trCyl33 = new Transform3D();
                            trCyl33.set(new Vector3f(0f,-0.5f,-0.2f));
                            trCyl3.mul(tr1);
                            trCyl3.mul(trCyl33);
    Transform3D trCyl3rot = new Transform3D();
    trCyl3rot.rotZ(90*Math.PI/180);
    trCyl3.mul(trCyl3rot);
    TransformGroup trGcyl3 = new TransformGroup(trCyl3);
    Cylinder cyl3 = new Cylinder(0.2f,0.5f,appCyl);
    trGcyl3.addChild(cyl3);
   
    Transform3D tr4 = new Transform3D();
    tr4.set(new Vector3f(0f,-1.5f,0f));
    tr3.mul(tr4);
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.