Skip to main content

Birds'eye view / multiple views to a scene

6 replies [Last post]
mrohrmoser
Offline
Joined: 2005-12-12
Points: 0

Hi list,
when trying to port http://www.jcurl.org/jws/org/jcurl/demo/tactics/0.7-SNAPSHOT/launch.jnlp from piccolo to scenario I hit the wall integrating a bird's eye view.

I took a 2nd JSGPanel and added the scene - this seems to destroy the "original" JSGPanel.

Is this supposed to be possible? Display a scene or subscene in multiple JSGPanels?

Greetings,
M

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jim Graham

Having scene graphs in multiple places is on a long term wish list, but
we don't have a good handle on how to implement it and maintain a lot of
our optimizations. Since nodes cache information that can only be
determined by scanning their ancestors we'd have to have a complicated
multiple-ancestry registry of this information or we'd have to have the
trees disable their optimizations when they appear in more than one place.

In short, we're aware of the feature and still working out how to best
integrate it into our implementation...

...jim

scenario@javadesktop.org wrote:
> Is there really nobody who's able and willing to answer this question?
>
> If it's no possible to display the same scene in multiple panels this is a pain for quite a number of use-cases. Is duplicating and syncing the scene the only solution?
>
> If it's possible it's well hidden in the API, a hint would be kind.
>
> Greetings,
> M
> [Message sent by forum member 'mrohrmoser' (mrohrmoser)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279934
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

mrohrmoser
Offline
Joined: 2005-12-12
Points: 0

Is there really nobody who's able and willing to answer this question?

If it's no possible to display the same scene in multiple panels this is a pain for quite a number of use-cases. Is duplicating and syncing the scene the only solution?

If it's possible it's well hidden in the API, a hint would be kind.

Greetings,
M

mbien
Offline
Joined: 2007-04-29
Points: 0

Hello mrohrmoser,

I don't think this will work out of the box. If you have a node which has already a parent and you add the node to someone else as child, it will be removed from its former parent (look at the implementation of the add method).

The only possible solution i can imagine is to render your scene into a buffered image (transform the scene before rendering if necessary) and paint it somewhere else.

The api seems to be almost too simple in some areas which makes it harder to use it in some situations (like in your case or in my where i tried to change paint order after nodes where already added to a group).

Jim Graham

Unfortunately the app (JCurl) looks like it needs more than just
painting a scene in two places, the webstart version in the first post
was interactive in both views...

...jim

scenario@javadesktop.org wrote:
> Hello mrohrmoser,
>
> I don't think this will work out of the box. If you have a node which has already a parent and you add the node to someone else as child, it will be removed from its former parent (look at the implementation of the add method).
>
> The only possible solution i can imagine is to render your scene into a buffered image (transform the scene before rendering if necessary) and paint it somewhere else.
>
>
> The api seems to be almost too simple in some areas which makes it harder to use it in some situations (like in your case or in my where i tried to change paint order after nodes where already added to a group).
> [Message sent by forum member 'mbien' (mbien)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279970
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

mrohrmoser
Offline
Joined: 2005-12-12
Points: 0

Thanks Jim and mbien for the replies,

Jim you're right, the second view is also active, so rendering an image is a loss of (maybe disposable) functionality. But following the GUI design principle of "least surprise" I'd really like to keep a read/write bird's eye.

I understand, that the complexitiy under the hood might badly increase with multiple ancestry - but how does piccolo / jazz handle this? At least piccolo has a sort of "layer" concept, so there's only two special node types (PCamera/PLayer) who have to handle this non-unique ancestry stuff. I add links to sources where I use this feature below - maybe you want to look into the piccolo implementation some time to come.

So this feature is currently not existent but maybe might come somewhen in the future if not blocked by valuable rendering optimisations.

I'll hope for the best.

Thanks a lot,
M

P.S.:
obtain a 2nd reference to the scene: http://jcurl.org/m2/site/jc-demo/0.7-SNAPSHOT/xref/org/jcurl/demo/tactic...
display it: http://jcurl.org/m2/site/jc-demo/0.7-SNAPSHOT/xref/org/jcurl/demo/tactic...

Jim Graham

There are a couple of things that come into play here in our implementation.

The first is dirty state propagation. When nodes are dirty they need to
notify their parent chain so that we know which parts of the tree need
to be revisited and potentially invalidate the parent bounds if our
bounds changed. A coupling mechanism like the PCamera/PLayer pair that
you described could easily help with that and let most nodes only have
to deal with 1 parent and then only the couplings would need to deal
with multiple parents.

The second is cached information about bounds and transforms for event
propagation and optimized repainting. If you can have multiple ancestry
then you can have multiple device bounds - on a per-node basis. That's
the part that gets hard when you can descend from multiple locations
each of which has its own transform and location. One solution there
could be to turn off these caches for all nodes that descend from a
coupling. Another solution would be to cache 1 set of info - say, for
the primary view - and then use the cached info if you are in the chain
that matches the assumptions it was cached under and use uncached info
in other cases.

More sophisticated solutions we've pondered involved keeping a complete
shadow tree that provides all of the internal data that we need for
rendering and event propagation and updating that tree when the nodes
changed. This would remove the cached information from the nodes
themselves so their ancestry wouldn't be much of an issue. It's a lot
more tricky to manage something like that and keep it in sync with the
nodes as the nodes individually change, though.

I think it's probably feasible to do it in a way that avoids any
performance penalties for the single-view case, but it's a risky change
right now and we are trying to stabilize the Scenegraph Project while we
work on an FX preview release on top of it...

...jim

scenario@javadesktop.org wrote:
> Thanks Jim and mbien for the replies,
>
> Jim you're right, the second view is also active, so rendering an image is a loss of (maybe disposable) functionality. But following the GUI design principle of "least surprise" I'd really like to keep a read/write bird's eye.
>
> I understand, that the complexitiy under the hood might badly increase with multiple ancestry - but how does piccolo / jazz handle this? At least piccolo has a sort of "layer" concept, so there's only two special node types (PCamera/PLayer) who have to handle this non-unique ancestry stuff. I add links to sources where I use this feature below - maybe you want to look into the piccolo implementation some time to come.
>
> So this feature is currently not existent but maybe might come somewhen in the future if not blocked by valuable rendering optimisations.
>
> I'll hope for the best.
>
> Thanks a lot,
> M
>
> P.S.:
> obtain a 2nd reference to the scene: http://jcurl.org/m2/site/jc-demo/0.7-SNAPSHOT/xref/org/jcurl/demo/tactic...
> display it: http://jcurl.org/m2/site/jc-demo/0.7-SNAPSHOT/xref/org/jcurl/demo/tactic...
> [Message sent by forum member 'mrohrmoser' (mrohrmoser)]
>
> http://forums.java.net/jive/thread.jspa?messageID=280080
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net