Well.. Lol ..
Im also trying to figure out exactly the same thing..  Take this code as
your starting point.. It applies flex components on top of a cube.. Not
inside it ..

I hope it helps..


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" applicationComplete="init()"
horizontalScrollPolicy="off" verticalScrollPolicy="off"
backgroundImage="@Embed(source='../bin-debug/layout.JPG')">
 <mx:Canvas visible="false">
<mx:Panel  id="registrationPanel" layout="vertical" horizontalCenter="0"
top="100" bottom="100" horizontalScrollPolicy="off"
verticalScrollPolicy="off">
<mx:Form x="10" y="10" width="100%" height="100%" fontFamily="Times New
Roman" fontSize="25" id="form1">
<mx:FormHeading label="Register" fontSize="25" fontWeight="normal"
textAlign="left"/>
<mx:FormItem label="Username" fontFamily="Verdana" fontSize="18"
id="formitem1">
<mx:TextInput id="reg_username" width="200"/>
</mx:FormItem>
<mx:FormItem label="Password" fontFamily="Verdana" fontSize="18"
id="formitem2">
<mx:TextInput id="reg_password" width="200" displayAsPassword="true" />
</mx:FormItem>
<mx:FormItem label="Confirm Password" fontFamily="Verdana" fontSize="18"
id="formitem3">
<mx:TextInput id="pwd" width="200" displayAsPassword="true"/>
</mx:FormItem>
<mx:FormItem label="Home Unit ID" fontFamily="Verdana" fontSize="18"
id="formitem4">
<mx:TextInput id="reg_ccuid" width="200"/>
</mx:FormItem>
<mx:FormItem label="Email" fontFamily="Verdana" fontSize="18">
<mx:TextInput id="reg_email" width="200"/>
</mx:FormItem>
<mx:Canvas width="100%">
<mx:Button label="Back" fontSize="14" left="0" width="75"
click="moveToLogin()"/>
<mx:Spacer/>
<mx:Button label="Next" fontSize="14" id="button1" right="0" width="75"/>
</mx:Canvas>
</mx:Form>
</mx:Panel>
</mx:Canvas>
 <mx:Canvas visible="false" >
<mx:Panel  layout="vertical" id="loginPanel" verticalScrollPolicy="off"
horizontalScrollPolicy="off" horizontalCenter="0" verticalCenter="0">
<mx:Form x="10" y="21" width="100%" height="100%" right="5" top="5" left="5"
bottom="5">
<mx:FormItem label="Login:" fontFamily="Verdana" fontSize="18">
<mx:TextInput right="5" id="username"/>
</mx:FormItem>
<mx:FormItem label="Password:" fontFamily="Verdana" fontSize="18">
<mx:TextInput displayAsPassword="true" right="5" id="password"/>
</mx:FormItem>
<mx:Canvas width="100%">
<mx:Button label="Login" fontSize="14" right="0" width="75"/>
</mx:Canvas>
<mx:FormItem direction="horizontal">
<mx:Spacer/>
<mx:Spacer/>
</mx:FormItem>
<mx:Canvas width="100%">
<mx:LinkButton label="Register" fontFamily="Verdana" fontSize="20"
horizontalCenter="0" click="moveToRegister()"/>
</mx:Canvas>
</mx:Form>
</mx:Panel>
</mx:Canvas>

<mx:Script>
<![CDATA[
import mx.containers.Canvas;
import caurina.transitions.Tweener;
import mx.effects.Effect;
import mx.effects.Tween;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Cube;
import org.papervision3d.materials.MovieMaterial;
import mx.core.UIComponent;
import org.papervision3d.cameras.CameraType;
import org.papervision3d.view.BasicView;
 private var view:BasicView;
private var cube:Cube;
private var target:Number = 0;
//private var uicomp:UIComponent;
 private function init():void
{
view = new BasicView(0,0,true,true,CameraType.FREE);
//uicomp = new UIComponent();
uicomp.addChild(view);
loadPlanes();
 //this.removeAllChildren();
//this.addChild(uicomp);
}
 private function moveToRegister():void
{
//var eff:Effect = new Effect(cube);
//eff.
//target = 90;
Tweener.addTween(cube,{rotationY:90,time:1,transition:"easeInOutBack"});
}
 private function moveToLogin():void
{
//target = 0;
Tweener.addTween(cube,{rotationY:0,time:1,transition:"easeInOutBack"});
}


private function loadPlanes():void
{
var cnv:Canvas = this.getChildAt(1) as Canvas;
var child:DisplayObject = cnv.getChildAt(0);
var loginMaterial:MovieMaterial = new MovieMaterial(child,false,true,false);
loginMaterial.interactive = true;
loginMaterial.smooth = true;
loginMaterial.allowAutoResize = true;
//loginMaterial.doubleSided = true;
 var regMaterial:MovieMaterial = new
MovieMaterial(registrationPanel,false,true,false);
regMaterial.interactive = true;
regMaterial.smooth = true;
regMaterial.allowAutoResize = true;
 var matList:MaterialsList = new MaterialsList();
matList.addMaterial(loginMaterial,"back");
matList.addMaterial(regMaterial,"right");
//matList.addMaterial(loginMaterial,"all");
//var plane:Plane = new
Plane(loginMaterial,loginPanel.width,loginPanel.height,6,6);
//plane.useOwnContainer = true;
cube = new Cube(matList,500,500,500,20,1,20);
cube.useOwnContainer = true;
//view.camera.zoom = 10;
view.camera.moveForward(300);
view.scene.addChild(cube);
//loginMaterial.doubleSided = true;
this.addEventListener(Event.ENTER_FRAME,enterFrameHandler);

}
 private function enterFrameHandler(event:Event):void
{
view.singleRender();
/* if( int(cube.rotationY) < int(target) )
{
 cube.rotationY += 2;
}
else if( int(cube.rotationY) > int(target) )
{
cube.rotationY -= 2;
} */
//cube.yaw(1);
}
 ]]>
</mx:Script>
<mx:UIComponent id="uicomp" top="0" bottom="0" left="0" right="0"/>
</mx:Application>


On Thu, Mar 19, 2009 at 9:12 AM, rajlaxmi jalan <[email protected]>wrote:

> yes Papervision3D, im trying develop a 3D room(using cube) with various 2D
> objects mounted on the walls, i need to know how i can proceed further. Can
> u refer to the demo on http://dev.getoutsmart.com/os3d/demos/videoroom. .
> How do we code this. Any  idea.
>
> On Wed, Mar 18, 2009 at 11:12 PM, ganaraj p r <[email protected]> wrote:
>
>> Hi,
>> Are you referring to papervision?
>>
>> What would you like to know?
>>
>> On Wed, Mar 18, 2009 at 5:53 PM, rajlaxmi <[email protected]>wrote:
>>
>>>
>>> Is anybody working on 3D in flex.
>>>
>>>
>>>
>>
>>
>> --
>> Regards,
>> Ganaraj P R
>>   >>
>>


-- 
Regards,
Ganaraj P R

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to