Skip navigation
pdesmeules
Currently Being Moderated

Embed 3D viewport in a Flex application

Nov 2, 2011 7:56 PM

Tags: #flex #application #proscenium #viewport

Hi,

 

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%"

                                                     backgroundColor="#8F7979">

                    <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)"/>

                              </s:Group>

                    </s:BorderContainer>

          </s:BorderContainer>

 

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

 
Replies
  • Currently Being Moderated
    Nov 3, 2011 5:21 AM   in reply to pdesmeules

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points