使用Mxml標籤撰寫PV3D

先前在pv3d.org看到的寫法,的確蠻特殊的,不過教學不多,這樣的寫法只能說比較簡潔,由於底層不是Flex元件,所以Flex的功能幾乎都不能用...,有興趣的朋友還是可以看看

寫個小練習:


2009-04-06_202629.jpg

<?xml version="1.0" encoding="utf-8"?>
<view:BasicView 
xmlns:mx="http://www.adobe.com/2006/mxml" 
xmlns:view="org.papervision3d.view.*" 
xmlns:scenes="org.papervision3d.scenes.*" 
xmlns:primitives="org.papervision3d.objects.primitives.*" 
xmlns:materials="org.papervision3d.materials.*" 
opaqueBackground="#ffffff"

<mx:Script>
<![CDATA[
import org.papervision3d.core.math.Sphere3D;
override protected function onRenderTick(event:Event = null):void
{
super.onRenderTick(event);
mySphere.yaw(12);
}
]]>
</mx:Script>
<view:scene>
<scenes:Scene3D>
<scenes:objects>
<primitives:Plane id="myPlane"
x="0" y="70" z="-300"
rotationX="-90">
<primitives:material>
<materials:ColorMaterial 
fillColor="0xFF0000" />
</primitives:material>
</primitives:Plane>
<primitives:Sphere id="mySphere"
x="0" y="190" z="-300">
<primitives:material>
<materials:WireframeMaterial/>
</primitives:material>
</primitives:Sphere>
</scenes:objects>
</scenes:Scene3D>
</view:scene>
</view:BasicView>

0 意見 :: 使用Mxml標籤撰寫PV3D