DODO Meva wrote:

Thanks about the tutorial that I don't stop to examin !

   /**
    * Main method.
    *
    * @param args None handled
    */
   public static void main(String[] args) {

       SimpleSAIDemo demo = new SimpleSAIDemo();

   }

}

My question is :

Without using an ExternalBrowser, is it possible to create a scene like one
does with Java3D ?



The short answer is yes.  The long answer is its not really documented.
Xj3D itself uses itself internally this way.

What is it about Xj3D that you want that isn't covered by an API like
Java3D or Aviatrix3d?

To this day, I don't see how to create my scene without loading a file.



Look at the create nodes example I'm attaching, does this do what you want?


=========================================================================== 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".
/*****************************************************************************
 *                        Web3d.org Copyright (c) 2004
 *                               Java Source
 *
 * This source is licensed under the GNU LGPL v2.1
 * Please read http://www.gnu.org/copyleft/lgpl.html for more information
 *
 * This software comes with the standard NO WARRANTY disclaimer for any
 * purpose. Use it at your own risk. If there's a problem you get to fix it.
 *
 ****************************************************************************/

import java.awt.*;
import java.util.HashMap;
import javax.swing.*;

import org.web3d.x3d.sai.*;

/**
 * A simple example of how to use SAI to load a scene and modify a value.
 *
 * @author Alan Hudson
 * @version
 */
public class CreateNodeSAIDemo extends JFrame {

    /**
     * Constructor for the demo.
     */
    public CreateNodeSAIDemo() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container contentPane = getContentPane();

        // Setup browser parameters
        HashMap requestedParameters=new HashMap();
        requestedParameters.put("Xj3D_ShowConsole",Boolean.FALSE);

        // Create an SAI component
        X3DComponent x3dComp = 
BrowserFactory.createX3DComponent(requestedParameters);

        // Add the component to the UI
        JComponent x3dPanel = (JComponent)x3dComp.getImplementation();
        contentPane.add(x3dPanel, BorderLayout.CENTER);

        // Get an external browser
        ExternalBrowser x3dBrowser = x3dComp.getBrowser();

        setSize(500,500);
        show();


        // Create an X3D scene by loading a file
        X3DScene mainScene = x3dBrowser.createX3DFromURL(new String[] { 
"create_nodes.x3dv" });

        // Replace the current world with the new one
        x3dBrowser.replaceWorld(mainScene);

        x3dBrowser.beginUpdate();
        X3DNode shape = mainScene.createNode("Shape");
        SFNode shape_geometry = (SFNode) (shape.getField("geometry"));
        X3DNode box = mainScene.createNode("Box");

        shape_geometry.setValue(box);

        shape.realize();

        mainScene.addRootNode(shape);
        x3dBrowser.endUpdate();
    }

    /**
     * Main method.
     *
     * @param args None handled
     */
    public static void main(String[] args) {

        CreateNodeSAIDemo demo = new CreateNodeSAIDemo();
    }

}

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