Hi, This is first time that I subscribe my java3d problem, so Hi to every one:

I have loaded an obj file and I can see the scene on my 3d cavas, but I can
not use the   TransformGroup object from the scene object of the loader.
 I couldn't use the mouse to move the object, because it requires the
TransformGroup object.

I have go through the news and mailing list discussions and the java 3d demos
on obj loader to search this kinds of topic, but did not get the answer.
Please help.

Here is the sample of my java 3d code:

ObjectFile iCADloader = new ObjectFile(ObjectFile.RESIZE);
 Scene iCADscene[] = new Scene[1];
TransformGroup iCADtransformgroup[] = new TransformGroup[3];


    public ds_Model( Canvas3D c )
    {
        canvas = c;

      String filename = "C:\\DesignSolution_Projects\\Model3d\\airboat.obj";

       try {
          iCADscene[0] = iCADloader.load(filename);
        }
        catch(FileNotFoundException e)
        {
        System.err.println(e);
        System.exit(1);
        }

        for (int i = 0; i < 3; i++)
          iCADtransformgroup[i] = new TransformGroup();

        BranchGroup objRoot = new BranchGroup();
        objRoot = iCADscene[0].getSceneGroup();

        Transform3D textMat = new Transform3D();


       for (int i = 0; i < 3; i++)
          iCADtransformgroup[i].setTransform(textMat);


iCADtransformgroup = iCADscene[0].getViewGroups();

This line of code always give me a null pointer exception and I could not get
this TransformGroup object.


Are there any thing I have missed to put in?
Please give me some suggestions?

Please help.


Rachel Jiang
Technical Leader
Design Solution.com

Canada

===========================================================================
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