Java scene graph

I'm been trying to find a utility that can parse through my java 3D code and create the scene graph for the code, but I've had no luck in finding such a program. Does anyone know about such program ?
If the above program doesnt exist, can anyone recommend a editor program for java 3d that contains all the different symbols to make it easier to draw the scene graph myself.
Thanks for any help.

You might find a texchnique I am employing for turn X3D into BranchGroups in Java3D. I have it at sourceforge.
http://cvs.sourceforge.net/viewcvs.py/mathml-x/mathml-x/stylesheets/X3D2Java3D.xsl?rev=1.4&view=markup
The xsl transforms to source code that is a part of Java3D scene graph and can be hooked into a viewer where the branches come from multiple x3d documents. After it is done once and compiled it doesn't need compiling again until a X3D document changes. Then only the one with the change. This is surprisingly fast and can produce only needed code to go along with for example an applet. The applet doesn't require a big engine.

Similar Messages

  • How Can I add a object to the scene Graph ??

    Hi all!
    I have set up a 3d scene Graph. Now I want to add a object (for example,a cone) to the scene Graph. How can I do ???
    thanks in advance!

    Hi,
    if you want to add your cone to a branchgroup "mainbranchgroup", you have to set mainbranchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE) while creating this branchgroup (and before compiling the scene).
    Then, when you want to add the cone, you just have to add a child to the mainbranchgroup.
    I hope that helps.

  • Hiding and unhiding arbitrary nodes in a scene graphs with animations

    Could someone point me out to how could I dissolve (or any other animation effect) an arbitrary node (with its children) in the scene graph when I click in certain label ?. And how could I show them, also with an animation, when the label is clicked again?.
    I am thinking in using a label since hyperlinks have always an annoying rectangle surrounding them. Is it correct to use a label for what I want ? if a hyperlink is better, how could I hide the rectangle that surrounds it by default ? (I think it means that the hyperlink has the focus).
    Thanks!

    The node disolves smootly, but then the space is suddently reclaimed once it has been dissolved. I would like that the node shrinks until it dissappears. For a resizable node (e.g. a layout pane or control)
    Use a Timeline. Adjust the maximum size of the controls to 0 as a KeyValue in a keyframe.
    http://docs.oracle.com/javafx/2/api/javafx/scene/layout/Region.html#maxWidthProperty
    http://docs.oracle.com/javafx/2/api/javafx/scene/layout/Region.html#maxHeightProperty
    http://docs.oracle.com/javafx/2/api/javafx/animation/Timeline.html
    For a non-resizable node (e.g. a Shape or Image), put it in a resizable node first, then adjust as above.
    You might also need to set the min size to zero to allow the node to disappear completely.
    Afterwards, I would like to put it back to its default preferred size when a certain event occurs.Store the current value of the max size before you start to adjust the Node's layout and restore the max size once done.
    Another alternative to the above is to adjust the Node's clip.
    http://saidandem.blogspot.com/2012/01/sliding-in-javafx-its-all-about.html

  • Q: Detecting when a Node is Detatched from the Scene Graph, How?

    Hi All,
    My nodes are regiserted observers with an Async service. I need to know when a nodes is detached/removed from the Scene graph so that I can remove it from the Async service.
    The only thing I can think of at the moment is to bind to Node.scene but I would like to think there is a more "standardized" way of doing this (I don't want to re-invent the wheel).
    Example (improved from 1st post):
    class MyCustomNode extends CustomNode {
            var sceneMonitor:Scene = bind scene on replace {onSceneChange()};       
            public var onSceneChange:function():Void = function():Void{
                    if (scene == null){
                        println("we have no scene");
                    } else {
                        println("we have a scene");
    }Edited by: AndrewHughes on Oct 12, 2009 6:13 AM

    You can add an "initialized" flag into your CustomNode and set it true in the postinit block
    var initialized = false;
    postinit { initialized = true }The parent and scene of the node won't be set until after the CustomNode is past the postinit phase. You can use this flag to determine whether or not the change in parent or scene is because the node is being added, or because the node is being removed.
    var fubar = bind scene on replace {
        if (initialized and scene == null) {
            // cleanup
    }You could also use the old value and the new value in the on replace:
    var fubar = bind scene on replace oldscene = newscene {
        if (oldscene != null and newscene == null) {
            // cleanup
    }

  • What makes a JavaFx 1.2 Scene Graph Refresh?

    My first question =). I'm writing a video game with a user interface written in JavaFx. The behavior is correct, but I'm having performance problems. I'm trying to figure out how to figure out what is queuing up the refreshes which are slowing down the app.
    I've done some profiling and believe that the majority of the computation time in my code is spent in JSGPanelRepainter.repaintAll(). Because this is called through a repaint manager, tracing to what is causing the repaintAll to be queued has proven to be challenging. I've read [this post|http://learnjavafx.typepad.com/weblog/2009/04/javafx-performance-tips-from-michael-heinrichs.html] on best practices for performance, but want to be able to identify conclusively what event is causing my performance problem.
    Does anyone have any suggestions on how to trap the event that is queuing up the repaintAll? I'm using Fx 1.2 and programming in Netbeans.

    Basically, anytime you modify the scene graph. Even though the method is called repaintAll, it is only repainting the dirty regions.
    There is no way to trap the event that is queuing up the repaintAll.
    There was an interesting talk at JavaOne about animation timelines and games given by a guy named Peter Pilgrim. He has a blog here

  • Change scene in scene graph

    I'm writing a game with JavaFX. For the different screens I decided to implement them as different Scenes, so clicking on an action would swap the scene in the application.
    The initial scene is naturally attached to the scene graph. Any scene that is later replacing the scene in the scene graph is not. When swapping it in, certain layouting for the scene is not done.
    While I know how to circumvent this (by calling the additional layouting methods, which are bound to the scene size change, when swapping), there are some things that I would like to understand:
    Is there a better way to do this?
    Is there a method on the scene that could be called to force the proper layouting
    Why does the scene only change initially when attaching it to the scene graph before showing it, but not when changing the scene at runtime?

    This looks like RT-30392. It is fixed in JavaFX 8.
    Another way to approach this is to use a single scene, and change the contents of the scene by calling setRoot(...). This works around the bug; I also usually find this approach a little cleaner as you only need access to the Scene, not to the stage.

  • How to change scene graph from listener thread?

    Greetings,
    I need a little help with javafx.concurrency.Task - I think.
    I have a JavaFX program that is listening for JMX Notifications. When I receive certain notifications, I want to change the scene graph. Of course, the notifications are being received on a thread kicked off by RMI, not the JavaFX Application thread -- so anything I try to do to the scene graph there won't work.
    I've look at Richard Bair's article: http://fxexperience.com/2011/07/worker-threading-in-javafx-2-0/
    and other examples, but every example I've found involves kicking off the Task from the Application thread and observing some property of the Task.
    I think I somehow need by Notification listener to queue up the things that need to be done to the scene graph somewhere, and then have a thread started from the Application thread read the queue and actually make the changes.
    I could use a pointer to an example, or even a general overview of how this type of thing should be accomplished. I could post a code example if needed, but it will take some doing and it wouldn't even be working.
    Thanks,
    Cameron

    Tasks/Service are most useful when you are initiating the action via the GUI (i.e. as a result of a button press, a mouse event, a keyboard action, etc). In your case JMX/RMI will be running an internal 'listener' thread which is triggering your handler method. In this case the best option is to just use Platform.runLater.
    Something like the following"
    {code}
    public void handleEventFromServer(final MyData dataFromServer)
    Platform.runLater(new Runnable() {
    public void run()
    // this will be done in your GUI thread so you can update the GUI here
    myTextField.setText("Result from server is: " + dataFromServer.getSomeValue());
    {code}
    If you have some sort of JmxListener interface you could just create a ThreadSafe event propagator like so:
    {code}
    public class ThreadSafeJmxListener implements JmxListener
    private JmxListener actualListener;
    public ThreadSafeJmxListener(JmxListener actualListener)
    this.actualListener = actualListener;
    @Override
    public void handleJmxEvent(final JmxEvent event)
    Platform.runLater(new Runnable() {
    public void run()
    actualListener.handleJmxEvent(event);
    {code}
    Then just use it something like so:
    {code}
    jmxChannel.addJmxListener(new ThreadSafeJmxListener(new JmxHandler()
    public void handleJmxEvent(final JmxEvent event)
    // this will be done in your GUI thread so you can update the GUI here
    myTextField.setText("Result from server is: " + dataFromServer.getSomeValue());
    {code}
    If you want to send data to the server, use a task (or service) for that. If you need more info on that, post back, but there is a fair bit of that in this forum, or on various blogs (you'll find a fair few examples buried in my posts: http://zenjava.com).

  • Investigate the scene graph at runtime

    Currently I am looking into how to investigate the scene graph at runtime. The main focus is to figure out what styles are applied to the nodes.
    Before I implement a solution of my own, I wanted to ask, if there is already something available, that goes in that direction.

    Use ScenicView for runtime style class investigation.
    Use the SceneBuilder CSS analyzer for design time css analysis.
    From code, use a recursive print function to produce a simple dump of the scene graph, including css style classes applied.
      // debugging routine to dump the scene graph.
      public  static void dump(Node n) { dump(n, 0); }
      private static void dump(Node n, int depth) {
        for (int i = 0; i < depth; i++) System.out.print("  ");
        System.out.println(n);
        if (n instanceof Parent) for (Node c : ((Parent) n).getChildrenUnmodifiable()) dump(c, depth + 1);

  • Embed VLC video output into a Scene Graph

    Hello,
    I'm trying to embed a VLC player in a JavaFX 2.2 application.
    For that I'm using the libvlc.dll library's API.
    VLC provided two ways to render a video:
    1. Call API function that takes HWND: +libvlc_media_player_set_hwnd (libvlc_media_player_t p_mi, void drawable)+ Set a Win32/Win64 API window handle (HWND) where the media player should render its video output.
    2. Register a callback that gets called every time a frame should be rendered: +libvlc_video_display_cb (void opaque, void picture) Callback prototype to display a picture.+
    With the HWND approach, I managed to extract an HWND pointer of the Scene using Glass framework, causing the video to render on the whole scene, no other nodes are visible.
    With the Callback approach, and by using JavaFX 2.2 new javafx.scene.canvas.Canvas node, I was able to throw pixels at the canvas, but it turns to be very inefficient in terms of memory and thread usage.
    I would love to have a solution as with AWT + JNA: the HWND can be extracted from java.awt.Canvas component (using JNA), and be given to libvlc API function. This canvas can be placed anywhere in the frame, not occupying all the entire window.
    Hard Guidelines:
    1. Integrating AWT/Swing with FX application is not an option, I want it to be a pure JavaFX application.
    2. Using JavaFX Media API for playback is not an option, since I have a requirement to modify the media player's source code.
    3. The video must not occupy the entire window, allowing other components to be visible.
    Possible solution is to create my own node or control that will wrap Glass component View that has a HWND but I don't know how to bind and make it work with other Glass components.
    Any help would be appreciated.
    Thank you.
    Eli.

    I would be interested in a solution for this as well.
    I've already done a lot of experiments in this area trying many frameworks/players (Xuggler, GStreamer, VLC (VLCJ), MediaPlayer Home Cinema, DS4J, MPlayer) and it seems to be very hard to do what you ask. Best chances at the moment are to use GStreamer, which I've succesfully been able to overlay with JavaFX components in the same window (with a stiff CPU penalty though).
    The other frameworks all have their drawbacks (Gstreamer as well). Most are low level which makes things like switching streams or doing subtitles a lot harder, some have poor control interfaces that donot expose enough functionality, etc). GStreamers main drawback is efficiency when using the Canvas (about 50% slower than native) but solvable by throwing more hardware at it. Also until recently its builds were not very up-to-date. I intend to soon test it again and see if I can get a fully working Canvas style solution with it.
    Currently I use VLC (with VLCJ) and I play back videos in a seperate Frame, and have a second window (a Stage) that is transparent on top of it. This way I can mix JavaFX controls and a video. It is hackish and also annoying that you have to juggle two windows but it works fairly ok. This approach might also work for you if you resize the Canvas in the seperate frame to where it needs to be displayed and keep that area transparent in your JFX frame... but it is hardly optimal (but very fast since it can do direct rendering).
    I haven't tried recently to mix it directly with JavaFX, but from what I read it seems possible now... but I'm pretty sure it will incur the same kind of CPU penalty as with GStreamer's Canvas :(

  • Scene Graph traversal. Getting all the children of a node recursively

    Hi,
    Requirement: To resize all the controls of a scene (including controls that contain text like label, button) as per the scene size
    Approach: To implement the above requirement (see code snippet below), I added Listeners for width and height properties of a Scene and whenever the scene size changes, I get all the children of the root node of the scene and invoked the setScaleX() and setScaleY() for the children.
    Problem: In my design, labels and buttons are wrapped inside VBox, HBox etc. Method getChildrenUnmodifiable() returns only the first level of children and hence my HBox and VBox are getting scaled as per the scene size but not the children of VBox and HBox. Is there a built-in function to get all the children of a node recursively ? Or what is the best way to resize text as the scene size changes ?
    Scene mainScene = new Scene(borderPane, PERMANENT_WIDTH,
                    PERMANENT_HEIGHT, Color.HONEYDEW);
    rootNode = mainScene.getRoot();
            mainScene.widthProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldValue,
                        Object newValue) {
                    Double widthScalingFactor = ((Double) newValue) / PERMANENT_WIDTH;
                     ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                    for (Node child : children) {
                        child.setScaleX(widthScalingFactor);
            mainScene.heightProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldValue,
                        Object newValue) {
                    Double heightScalingFactor = ((Double) newValue) / PERMANENT_HEIGHT;
                    ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                    for (Node child : children) {
                        child.setScaleY(heightScalingFactor);
            });Thanks.

    Added the following code to get all the children recursively. now the scaling is applied to all nodes of a scene.
        private static void getChildren(Parent parentNode) {
            if (parentNode.getChildrenUnmodifiable().size() != 0) {
                ObservableList<Node> tempChildren = parentNode
                        .getChildrenUnmodifiable();
                allChildren.addAll(tempChildren);
                for (Node n : tempChildren)
                    getChildren((Parent) n);
            } else
                allChildren.add(parentNode);
        }

  • 9i Web Agent Error when displaying Java Table/Graph

    Hi,
    I am in the process of upgrading a Express 6.3.4 Web Agent database app to 9i.
    I have been able to import the databases correctly, under the OOWAAPP schema.
    On my app when ever I go to a page to display a Java Table I get the following error:
    oracle.olap.webAgent.express.OWAException: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Oracle OLAP Web Agent</TITLE></HEAD><BODY bgcolor="#FFFFFF"><P><img src="/oowa-install/sample/wabanner.gif" alt="Oracle OLAP Web Agent"></p><P><STRONG>An error occurred in the Oracle OLAP Web Agent</STRONG></p><STRONG>ORA-33272: (DBERR06) Analytic workspace IADSSDEMO.OOWASEL cannot be opened.
    ORA-01950: no privileges on tablespace 'IADSS'
    ORA-06512: at "SYS.DBMS_AW", line 18
    ORA-06512: at line 1
    </STRONG><P><!--<STRONG>Click <A HREF="/oowa-install/help/en/owacauseaction.html#ORA-33272: (DBERR06) Analytic workspace IADSSDEMO.OOWASEL cannot be opened.
    ORA-01950: no privileges on tablespace 'IADSS'
    ORA-06512: at SYS.DBMS_AW", line 18
    ORA-06512: at line 1
    ">here</A> to display information about potential causes for this error and about potential resolutions for the problem.</STRONG>--></p></BODY></HTML>
    The UserID I am logged in as is IADSSDEMO. While the AW are in the OOWA schema, I have forced them to use a tablspace of IADSS.
    The Page has some option/selectors followed by a java table.
    Any ideas?
    Regards,
    Imran Shah
    Ioppolo & Associates

    This forum is for Warehouse Builder related issues. Your question is better suited for the OLAP forum:
    OLAP

  • Don't know how to show different scene graph

    I need your help.
    That's what i want to do :
    I have two scenegraph which need to be in a same virtual universe (sharedGroup).
    I want to show one scenegraph in a Canvas3D and the other scenegraph in another Canvas3D.
    when i try to do something, both scenegraphs appairs in both Canvas3D.
    Please helpe me !!!

    So are you saying that there is not a little picture of the album on the left side of the name of the song?
    If it is not there then maybe you don't actually have the album art.
    If you want album art for your songs then I suggest using the program which is a widget.
    Here's the link if you want to take a look at what I am talking about:
    http://www.apple.com/downloads/dashboard/music/amazonalbumart.html
    You just type in the name of the album and then it will show up and then you just click apply to iTunes.
    Hope this helps!
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.
    Macbook   Mac OS X (10.4.8)   MacBook

  • A performance tip: scene graph content and bind

    I am working on my own table control and have found this affecting the performance significantly.
    case 1:
    Group {
        content: bind [variableContent]
    }case 2:
    Group {
        content bind variableContent
    }Although these two cases produce the same result (sequences in JavaFX is not nestable and will be auto-flatten), the underlying binding mechanism makes case 1 extremely slow than case 2 when dozens of elements are in variableContent.

    I would be interested in a solution for this as well.
    I've already done a lot of experiments in this area trying many frameworks/players (Xuggler, GStreamer, VLC (VLCJ), MediaPlayer Home Cinema, DS4J, MPlayer) and it seems to be very hard to do what you ask. Best chances at the moment are to use GStreamer, which I've succesfully been able to overlay with JavaFX components in the same window (with a stiff CPU penalty though).
    The other frameworks all have their drawbacks (Gstreamer as well). Most are low level which makes things like switching streams or doing subtitles a lot harder, some have poor control interfaces that donot expose enough functionality, etc). GStreamers main drawback is efficiency when using the Canvas (about 50% slower than native) but solvable by throwing more hardware at it. Also until recently its builds were not very up-to-date. I intend to soon test it again and see if I can get a fully working Canvas style solution with it.
    Currently I use VLC (with VLCJ) and I play back videos in a seperate Frame, and have a second window (a Stage) that is transparent on top of it. This way I can mix JavaFX controls and a video. It is hackish and also annoying that you have to juggle two windows but it works fairly ok. This approach might also work for you if you resize the Canvas in the seperate frame to where it needs to be displayed and keep that area transparent in your JFX frame... but it is hardly optimal (but very fast since it can do direct rendering).
    I haven't tried recently to mix it directly with JavaFX, but from what I read it seems possible now... but I'm pretty sure it will incur the same kind of CPU penalty as with GStreamer's Canvas :(

  • An example of using a graph library with JavaFX 2.0

    Hi
    I saw an example detailing how JavaFX 2.0 was used on-top of a graph library to visualize for example the java scene graph of a particular application.
    I could drag nodes around and add or remove them.
    I seem to have lost the link to that project and I just can't for the life of me find the website again....does anyone know the url to a project like described?
    Cheers,
    Nuwanda

    There has been a recent project using th Groovy JavaFX 2.0 bindings that combine JavaFX 2.0 and graphviz (a graphing library). Here are some links to that project:
    Video demo: http://www.screenr.com/X7cs
    Project source: https://bitbucket.org/bgoetzmann/grezi/wiki/Home
    Cheers,
    Jeff

  • Display contents of a loop  in SCENE

    Hi all,
    Can i display the contents of a for loop one after another in a "Scene".
    The code below displays the contents of "for" loop in OUTPUT window as well as in the "SCENE". But the problem is that the contents of "for" loop are displayed in the scene graph only after the for loop exits.
    how can i rectify this code to generate the output similar to the OUTPUT window in SCENE graph.?
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    import javafx.scene.text.Text;
    import ranno.*;
    import javafx.scene.control.Button;
    import javafx.scene.Group;
    import generateResult.*;
    var number: Integer[];
    var msg : String ;
    var a : String[];
    var locX: Integer;
    var locY: Integer;
    def canvas = Group { };
    var display : Button =Button {
    translateX: 100
    translateY: 100
    width : 100
    height : 30
    text : "Click"
    var text : Text
    action:function(){
    delete canvas.content;
    for(i in [0..1])
    java.lang.Thread.sleep(1000);
    number=i;
    println(number[i]);
    a=Integer.toString(number[i]);
    locX=20;
    locY=20;
    msg = "{a}";
    text = Text{
    x: locX
    y: locY+20*i
    content : msg
    insert text into canvas.content;
    Stage
    title: "Numbers"
    var array : String[];
    var i : Integer;
    scene : Scene
    width: 400
    height: 200
    content :
    [display,canvas]
    If you haven't understood my question,please execute this code and compare the output in the OUTPUT window with the SCENE output.
    I want the output in SCENE to be similar to the output in OUTPUT window.
    Please help me in modifying my code .

    Since you haven't used the CODE button, the source code is messed up (star means bold here).
    But the short answer is: don't use a loop with sleep()!
    JavaFX provides Timelines and Transitions to animate things and add stuff progressively to the scenegraph.

Maybe you are looking for