1 Reply Latest reply: Nov 3, 2011 5:21 AM by march2342 RSS

    Embed 3D viewport in a Flex application




      I use Flex to create a SWF application embedded in HTML. I actually try to add a 3D viewport to it using Proscenium. I can't figure out how to do it. It seems that the 3D proscenium stuff is hidden under other flex components.


      Here is a piece of mxml code that demonstrates what I try to do without success. I started from the ProsceniumSampleFlex sample code.


      <s:BorderContainer id="mainborder" y="0" right="0" width="100%" height="100%"


                          <s:BorderContainer id="border" y="0" left="0" width="20%" height="100%"

                                                                     backgroundAlpha="0.0" backgroundColor="#FF0000">

                                    <s:Group id="viewport" y="0" left="0" width="100%" height="100%" resize="resizeEventHandler( event )">

                                              <s:Button x="10" y="10" label="Click Me" enabled="true" click="clickHandler(event)"/>





      The best I did is to show both the 3D viewport and the bordercontainer beside. What I want is the viewport in a portion of the bordercontainer.


      Any help would be appreciated

        • 1. Re: Embed 3D viewport in a Flex application

          It seems that the 3D proscenium stuff is hidden under other flex components”


          It is.


          Keep in mind that stage3D is always going to be the base layer and to view it you must have clear visual path to it through the display list. Your outermost BC has a width/height of 100% with a set bgColor and bgAlpha defaulting to 1. This means that it’s completely covering any stage3D content you may be rendering behind it. It’s misleading when you set a Proscenium viewport to a component, thinking that the component “contains” the stage3D content. It doesn’t. It merely sets the screen constraints but it’s still “behind” everything else. So, make sure your backgroundAlpha’s are set to 0, including your application/windowedapplication when using MXML.