Mixing 2D and 3D
Chien Yang
chien.yang at oracle.com
Mon Jul 29 10:53:46 PDT 2013
Hi August,
It is good to bring to back old memory occasionally. I've almost
forgotten ViewSpecificGroup in Java 3D. :-) Thanks for sharing your
proof of concept work in using Node.snapshot. We will take a closer
study of your work. It is possible that you might have uncovered new
area where we have missing 3D support on existing feature.
Thanks,
- Chien
On 7/28/2013 10:14 AM, August Lammersdorf, InteractiveMesh wrote:
> "Simultaneous viewing based on Node.snapshot - proof of concept"
>
> Chien,
>
> certainly you remember Java 3D's multiple view concept based on
> ViewSpecificGroup (not easy to apply but powerful). It allows to
> assign the entire graph or sub-graphs or even single nodes to one or
> several cameras/canvases simultaneously. Animations (Behavior) are
> executed only once. Then the engine renders individually the
> assigned/extracted sub-scene for each camera/canvas.
>
> The current JavaFX Scene/SubScene-design leads to an exclusive
> one-to-one-relationship of a 2D/3D-scene-graph and a camera.
>
> Simultaneous views require at least individual lighting (headlight)
> per camera to avoid 'overexposure' or unwanted shading effects.
>
> Thanks for your 'Node.snapshot' implementation hint and code example.
>
> So, I tried to apply this approach to FXTuxCube and added a second
> camera. It works to some extend:
>
> 1st camera
> - some flicker for higher cube sizes during mouse navigation
>
> 2nd camera
> - one frame delayed
> - only default lighting/headlight, no individual lighting (?)
> - AmbientLight doesn't seem to be applied
> - no individual extraction of sub-graphs
> - currently permanent running AnimationTimer for repainting
>
> The first result - FXTuxCubeSV - can be launched and downloaded here:
> www.interactivemesh.org/models/jfx3dtuxcube.html#simview
>
> August
>
> Am Freitag, den 26.07.2013, 17:43 +0200 schrieb Chien Yang
> <chien.yang at oracle.com>:
>> Hi August,
>>
>> John Yoon, Richard and I have a private discussion on the
>> possibility of avoiding "cloning" for your use case. We wonder do you
>> ever need to interact with the 3D scene via the various sub views? Or
>> these sub views are purely for viewing the 3d scene with different
>> cameras? If this is your use case scenario, have you thought of using
>> Node.snapshot()?
>>
>> public WritableImage snapshot(SnapshotParameters params,
>> WritableImage image) {
>>
>> Where you can call snapshot on the node with a specified camera (in
>> the snapshot params). It will then render the node from that camera's
>> viewpoint and put the result in an WritableImage. You can then add it
>> into the scenegraph using an ImageView. I have attached a very simple
>> example on how snapshot can be used with an ancillary camera. Please
>> let us know of your progress in this work. We would hope to learn from
>> this work so that we can evaluate it to see if there are any
>> performance / semantic problems. You will likely ended up with a one
>> frame behind rendering in those sub views, but do let us know for your
>> finding.
>>
>> Thanks,
>> - Chien
>>
>
More information about the openjfx-dev
mailing list