Thanks Anand, Alvaro and aant!
I�ve tried all suggested solutions but still no line will display itself on
the screen. I did not quite understand Anand what you ment by the line
"geom.setColor(1, setColor);". Is it possible for you to explain closer? And
I�m very happy for any new suggestions that will bring me closer to
displaying the line.

Todda


Here�s the code again:

import com.interaction.i3d.*;
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.event.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.behaviors.vp.*;
import java.awt.*;
import java.awt.Component;
import java.util.Enumeration;

public class Linje extends Applet {

   public Linje() {

     setLayout(new BorderLayout());

     Canvas3D canvas3D = new Canvas3D(null);
     add("Center", canvas3D);

     SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
     simpleU.getViewingPlatform().setNominalViewingTransform();

     OrbitBehavior behavior = new OrbitBehavior
(canvas3D,OrbitBehavior.REVERSE_ALL);
     behavior.setSchedulingBounds(new BoundingSphere(new
Point3d(0,0,0),10.0));
     simpleU.getViewingPlatform().setViewPlatformBehavior (behavior);

     simpleU.getViewer().getView().setFrontClipDistance(0.1);
     simpleU.getViewer().getView().setBackClipDistance(30);

     BranchGroup scene = createSceneGraph();
     scene.compile();
     simpleU.addBranchGraph(scene);


   }

    public BranchGroup createSceneGraph(){

      BranchGroup aRouteBG = new BranchGroup();

      LineArray geom = new LineArray(2,
                        GeometryArray.COORDINATES |
GeometryArray.COLOR_3);

      Point3f point1 = new Point3f(-1f, -1f, -1f);
      Point3f point2 = new Point3f(1f, 1f, 1f);


      //Appearance
      Appearance lineApper = new Appearance();

      //LineAttrib
      LineAttributes lineAttrib = new LineAttributes();
      lineAttrib.setLineWidth(5);
      lineApper.setLineAttributes(lineAttrib);


      //Color
      Color3f lineColor = new Color3f(0.5f, 0.5f, 0.5f);
      ColoringAttributes lineCA = new ColoringAttributes();
      lineCA.setColor(lineColor);

      geom.setColor(0, lineColor);
      //geom.setColor(1, setColor);




      Shape3D lineShape = new Shape3D(geom,lineApper);
      aRouteBG.addChild(lineShape);
      return aRouteBG;
  }



  public static void main(String[] args){
   Frame frame = new MainFrame(new Linje(), 512, 512);
   }


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to