Package javax.vecmath

Examples of javax.vecmath.Point3d


  public void addLight(SimpleUniverse su)
  {

    BranchGroup bgLight = new BranchGroup();

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(-1.0f,0.0f,-0.5f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);
View Full Code Here


  private void createSceneGraph() {
      parent = new BranchGroup();
     
      ciel = new Background(new Color3f(0.9f, 0.9f, 1.0f));
      ciel.setCapability(Background.ALLOW_COLOR_WRITE);
      ciel.setApplicationBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      parent.addChild(ciel);
     
      parent.addChild(new ColorCube(0.4));
     
      TransformGroup tg = new TransformGroup();
      Transform3D translation;
      translation = new Transform3D();
      translation.setTranslation(new Vector3f (0, 0, 20));
      tg.setTransform(translation);
      Sphere sphere = new Sphere(1.2f);
      sphere.getAppearance().setColoringAttributes(new ColoringAttributes(0.1f, 0.8f, 0.8f, ColoringAttributes.NICEST));
      tg.addChild(sphere);
      parent.addChild(tg);
     
      TransformGroup tg2 = new TransformGroup();
      Transform3D translation2;
      translation2 = new Transform3D();
      translation2.setTranslation(new Vector3f (0, 0, -20));
      tg2.setTransform(translation2);
      Box box = new Box();
      tg2.addChild(box);
      parent.addChild(tg2);
     
      AmbientLight light = new AmbientLight(new Color3f(0.5f, 0.5f, 0.5f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
      light.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      parent.addChild(light);
     
      soleil = new DirectionalLight();
      soleil.setDirection(new Vector3f(0.1f, 0.1f, -0.5f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
      soleil.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      parent.addChild(soleil);
    }
View Full Code Here

  public void dessinerLigne(List<Point> ligne){
    BranchGroup bg = new BranchGroup();
    int stripVertexCounts[] = {ligne.size()};
    LineStripArray ligneArray = new LineStripArray(ligne.size(), LineArray.COORDINATES | LineArray.COLOR_3, stripVertexCounts);
    for (int i=0; i<ligne.size(); i++){
      ligneArray.setCoordinate(i, new Point3d(ligne.get(i).y, ligne.get(i).z + 0.2, ligne.get(i).x));
      ligneArray.setColor(i, new Color3f(Color.blue));
    }
    bg.addChild(new Shape3D(ligneArray));
    simpleU.addBranchGraph(bg);
  }
View Full Code Here

      simpleU.addBranchGraph(voiture1);*/
     
      DirectionalLight light2 = new DirectionalLight();
      light2.setDirection(new Vector3f(0.1f, -0.5f, 0.1f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
      light2.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      voiture1.addChild(light2);
     
      voiture1tg.addChild(CreateurVoiturePeugeot.creerForme(true));
      voiture1.addChild(voiture1tg);
      voiture1.compile();
View Full Code Here

      //Box box = new Box();
     
      DirectionalLight light2 = new DirectionalLight();
      light2.setDirection(new Vector3f(0.1f, -0.5f, 0.1f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
      light2.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      voiture2.addChild(light2);
     
      voiture2tg.addChild(CreateurVoiturePeugeot.creerForme(false));
      voiture2.addChild(voiture2tg);
      voiture2.compile();
View Full Code Here

    addLight(simpUniv);


    //The following three lines enable navigation through the scene using the mouse.
    OrbitBehavior ob = new OrbitBehavior(myCanvas3D);
    ob.setSchedulingBounds(new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE));
    simpUniv.getViewingPlatform().setViewPlatformBehavior(ob);


    //Show the canvas/window.
    setTitle("A tetrahedron");
View Full Code Here

  public void addLight(SimpleUniverse su)
  {

    BranchGroup bgLight = new BranchGroup();

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), Double.MAX_VALUE);
    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(-1.0f,0.0f,-0.5f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);
View Full Code Here

    addLight(simpUniv);


    //The following three lines enable navigation through the scene using the mouse.
    OrbitBehavior ob = new OrbitBehavior(myCanvas3D);
    ob.setSchedulingBounds(new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE));
    simpUniv.getViewingPlatform().setViewPlatformBehavior(ob);


    //Show the canvas/window.
    setTitle("Click the objects with the left mouse button.");
View Full Code Here

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

  public void addLight(SimpleUniverse su)
  {

    BranchGroup bgLight = new BranchGroup();

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

    //Directional light.
    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(-1.0f,0.0f,-0.5f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
View Full Code Here

TOP

Related Classes of javax.vecmath.Point3d

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.