Black Background behind MediaView Replicating 3D Movie Cube

Kevin Rushforth kevin.rushforth at oracle.com
Mon Oct 29 14:52:04 PDT 2012


The "MediaCube" demo we showed just uses a gradient "fill" on the Scene, 
but you should be able to achieve the same thing with a Rectangle of 
your own. You just need to turn off depth test on that rectangle.

-- Kevin


Peter Pilgrim wrote:
> Hi
>
> This is nothing to do with OpenJFX codebase or anything else
>
> I was working on ScalaFX just now. Writing a port of the CubeSystem
> Graphic 3D with MediaView instead of Rectangles. I am using my own
> downloaded movie trailers e.g. The Hobbit, Prometheus, Looper, Flight
> etc
>
> I want to give the MediaView a black background for the videos, keep
> the aspect ratio, and effectively give each cube a backing rectangle,
> so I naively did
>
> MediaViewCubeFace(val size: Double)  extends Group {
>   val backRect: Rectangle { fill = Color.Black }
>   val mediaView: MediaView { fitWidth = size; fitHeight = size }
>   Group {
>      children = Seq( backRect, mediaView)
>   }
>
>   /* ... */
> }
>
> None of the above compiles, does not matter.  What I found was on
> MacOS 10.8 Retine Display Java FX 7 update 9  there is a lot of
> flickering?
> "So I think I must be doing this wrong?" The media view rendered with
> the rectangle in front and sometimes behind. DepthTest is switched on.
> I tried setting a backRect.translateZ = -0.05 and that makes the
> problem worse. So there something I don't understand about 3D, can't
> put my finger on it.
>
> What did the JavaFX SDK team do to in the JavaOne (2011) demo? Did you
> put the MediaView inside a Pane or something else?
>
>   


More information about the openjfx-dev mailing list