Package com.sun.j3d.utils.geometry

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


    float boxHL = 0.7f*r; //Half the vertex length of the cube.
    float shift = 3.0f*r; //Distance between cube and sphere.


//*** The sphere and its transformation group ***
    Sphere s = new Sphere(r,Sphere.GENERATE_NORMALS,100,shadedApp);
    Transform3D tfSphere = new Transform3D();
    tfSphere.setTranslation(new Vector3f(-0.95f+r,0.0f,0.0f));
    TransformGroup tgSphere = new TransformGroup(tfSphere);
    tgSphere.addChild(s);
    theScene.addChild(tgSphere);
View Full Code Here


    //Generate the sphere, their transformations and their
    //transformation groups. Add everyting to the scene.
    for (int i=0; i<n; i++)
    {
      spheres[i] = new Sphere(r,Sphere.GENERATE_NORMALS,4+i*i*i,sphereApp);
      tf[i] = new Transform3D();
      tf[i].setTranslation(new Vector3f(-0.95f+r+shift*i,0.0f,0.0f));
      tg[i] = new TransformGroup(tf[i]);
      tg[i].addChild(spheres[i]);
      theScene.addChild(tg[i]);
View Full Code Here

    float boxHL = 0.7f*r; //Half the vertex length of the cube.
    float shift = 3.0f*r; //Distance between cube and sphere.


//*** The sphere and its transformation group ***
    Sphere s = new Sphere(r,Sphere.GENERATE_NORMALS,100,shadedApp);
    Transform3D tfSphere = new Transform3D();
    tfSphere.setTranslation(new Vector3f(-0.95f+r,0.0f,0.0f));
    TransformGroup tgSphere = new TransformGroup(tfSphere);
    tgSphere.addChild(s);
    theScene.addChild(tgSphere);
View Full Code Here

    //Radius of the cockpit.
    float cabinRadius = 0.1f;

    //Generate the cockpit in the form of a sphere.
    Sphere cabin = new Sphere(cabinRadius,blackApp);

    //The transformation group for the cockpit.
    //The cockpit first remains in the origin. Later on, the whole
    //helicopter is shifted onto the platform.
    TransformGroup tgCabin = new TransformGroup();
View Full Code Here

      //Radius of the cockpit.
      float cabinRadius = 0.1f;

      //Generate the cockpit in the form of a sphere.
      Sphere cabin = new Sphere(cabinRadius,greenApp);

      //The transformation group for the cockpit.
      //The cockpit first remains in the origin. Later on, the whole
      //helicopter is shifted onto the platform.
      TransformGroup tgCabin = new TransformGroup();
View Full Code Here

    //Generate the sphere, their transformations and their
    //transformation groups. Add everyting to the scene.
    for (int i=0; i<n; i++)
    {
      spheres[i] = new Sphere(r,Sphere.GENERATE_NORMALS,4+i*i*i,sphereApp);
      tf[i] = new Transform3D();
      tf[i].setTranslation(new Vector3f(-0.95f+r+shift*i,0.0f,0.0f));
      tg[i] = new TransformGroup(tf[i]);
      tg[i].addChild(spheres[i]);
      theScene.addChild(tg[i]);
View Full Code Here

        if (_changesAllowedNow) {
            scale = 1.0;
        }

        _containedNode = new Sphere((float) scale, primitiveFlags,
                divisionsValue, _appearance);

        if (_changesAllowedNow) {
            TransformGroup scaler = new TransformGroup();
            scaler.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
View Full Code Here

        } else {
            _iterationSynchronized = false;
        }

        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);
View Full Code Here

  public Micro(final Vector3d pos) {
    super();
    final Transform3D t = new Transform3D();
    t.setTranslation(pos);
    this.setTransform(t);
    final Sphere sphere = new Sphere(0.1f, new Sphere().getPrimitiveFlags(),
        210);
    sphere.getAppearance().getMaterial().setDiffuseColor(0, 0.1f, 0.5f);
    sphere.getAppearance().getMaterial().setAmbientColor(0f, 0.1f, 0.5f);
    sphere.getAppearance().getMaterial().setSpecularColor(0.3f, 0.8f, 0.4f);
    // sphere.getAppearance().getLineAttributes().setPatternMask(arg0);
    this.addChild(new AntiAliased<Sphere>(sphere));
  }
View Full Code Here

  public Ton(final Vector3d pos, final float r) {
    super();
    this.setCapability(BranchGroup.ALLOW_DETACH);
    this.pos = pos;
    this.sphere = new Sphere(r, new Sphere().getPrimitiveFlags(), 210);
    this.sphere.getAppearance().getMaterial().setDiffuseColor(0.9f, 0.1f, 0);
    this.sphere.getAppearance().getMaterial().setAmbientColor(0.9f, 0.1f, 0);
    this.sphere.getAppearance().getMaterial()
        .setSpecularColor(0.9f, 0.8f, 0.7f);
    // this.sphere.getAppearance().getLineAttributes().setPatternMask(arg0);
View Full Code Here

TOP

Related Classes of com.sun.j3d.utils.geometry.Sphere

Copyright © 2018 www.massapicom. 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.