<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>parpue.net &#187; Papervision</title>
	<atom:link href="http://parpue.net/tag/papervision/feed" rel="self" type="application/rss+xml" />
	<link>http://parpue.net</link>
	<description>Flash, Flex, デザイン等自分の好きなことを好きなようにやってます</description>
	<lastBuildDate>Wed, 12 Aug 2009 17:46:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Box2D と PaperVision3D を連携させてみる</title>
		<link>http://parpue.net/web/138</link>
		<comments>http://parpue.net/web/138#comments</comments>
		<pubDate>Mon, 28 Jul 2008 10:39:04 +0000</pubDate>
		<dc:creator>okm</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Papervision]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://parpue.net/?p=138</guid>
		<description><![CDATA[				Box2Dをちょっと勉強してみて、
				このライブラリでは、
				「物理演算させた結果を数値パラメータとして取り出して使う」、
				ということがわかってきた。
				Box２Dで遊んでいる人の多くが [...]]]></description>
			<content:encoded><![CDATA[				<p>Box2Dをちょっと勉強してみて、<br />
				このライブラリでは、<br />
				「物理演算させた結果を数値パラメータとして取り出して使う」、<br />
				ということがわかってきた。</p>
				<p>Box２Dで遊んでいる人の多くがそうであるように、<br />
				このパラメータを何で使ったらおもしろいかというひとつの行き先として、３D表示がある。<br />
				Flashには３D表現のライブラリとしては、<a href="http://blog.papervision3d.org/" target="_blank">PaperVision3D</a>が有名です。</p>
				<p>というわけで、３D表現とか未経験なので、勉強もかねて、<br />
				<a href="http://gihyo.jp/dev/feature/01/box2d/0002">技術評論社の簡単なBox２Dサンプル</a>の動作を、<br />
				Papervision3Dライブラリを使って３D表示させてみた。</p>
				<div style="border:solid 1px;padding:0;margin:0;width:430px;height:350px;margin-left:auto;margin-right:auto">
				<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="430" height="350"><param name="id" value="pvtest" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="src" value="http://parpue.net/wp-content/uploads/papervision.swf"/><embed id="pvtest" type="application/x-shockwave-flash" width="430" height="350" src="http://parpue.net/wp-content/uploads/papervision.swf"  scale="noscale" quality="high" allowscriptaccess="sameDomain" align="middle"></embed></object>
				</div>
				<p>↑　<strong>画面クリック</strong>で、箱が落ちます。<br />
				Box2D部分はほぼ技術評論社のものと変更ありません。</p>
				<p>Box2Dは、2次元の物理演算ライブラリなので、<br />
				PaperVision3Dを用いても、表示されている領域内では、２Dの動作しかしません。</p>
				<p>Box2Dで、毎フレームごとのX座標、Y座標、傾きなどの値を取り出して、<br />
				PaperVision3Dの世界に落とし込んでいます。</p>
				<p>というわけで、とりあえずPaperVision３Dの初体験ができましたｗ<br />
				がんばればもうちょっと面白いことできそうだなー。</p>
				<p>↓ソース全部。<br />
				<span id="more-138"></span><br />
				使用したPaperVision3Dライブラリのバージョンは<br />
				「Public Alpha 2.0 - Great White (24.03.08)」です。</p>
				<p>メインのPaperVisionTestクラス</p>
				<div class="igBar"><span id="lactionscript-3"><a href="#" onclick="javascript:showPlainTxt('actionscript-3'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-3">
				<div class="actionscript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">package src <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">b2AABB</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2PolygonDef</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Common</span>.<span style="color: #0066CC;">Math</span>.<span style="color: #006600;">b2Vec2</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2BodyDef</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2DebugDraw</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2World</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; * ...</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; * @author Default</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; */</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PaperVisionTest <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> world:b2World;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> boxBody:b2Body;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> pvView:PVView;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> PaperVisionTest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// イベントハンドラを登録する</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, clickHandler<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, enterFrameHandler<span style="color: #66cc66;">&#41;</span>;&nbsp;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvView = <span style="color: #000000; font-weight: bold;">new</span> PVView;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvView.<span style="color: #006600;">x</span> = -<span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvView.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #66cc66;">&#40;</span>pvView<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clickHandler<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 物理エンジンのセットアップ</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 外枠を定義する</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> worldAABB:b2AABB = <span style="color: #000000; font-weight: bold;">new</span> b2AABB<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worldAABB.<span style="color: #006600;">lowerBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;color:#800000;">100</span>, -<span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; worldAABB.<span style="color: #006600;">upperBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">100</span>, <span style="color: #cc66cc;color:#800000;">100</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 重力を下方向に10m/s^2とする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> gravity:b2Vec2 = <span style="color: #000000; font-weight: bold;">new</span> b2Vec2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 外枠と重力を指定して、物理エンジン全体をセットアップする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world = <span style="color: #000000; font-weight: bold;">new</span> b2World<span style="color: #66cc66;">&#40;</span>worldAABB, gravity, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床の設置</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床は画面の下のほうに設置します</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床の位置を左から2.1m、上から3mとする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> floorBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span>.<span style="color: #cc66cc;color:#800000;">15</span>, <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床の形を、幅4m、厚さ20cmとする</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 指定するのはその半分の値</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> floorShapeDef:b2PolygonDef = <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; floorShapeDef.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span>, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 床を動かない物体として作る</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">floor</span>:b2Body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>floorBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">floor</span>.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>floorShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の設置</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱は床の上から落として、少しはねるようにします</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の位置を左から2.5m、上から1mとする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> boxBodyDef:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBodyDef.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span>.<span style="color: #cc66cc;color:#800000;">5</span>, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の形を、幅60cm、高さ40cmとして45度ぐらい右に回す</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> boxShapeDef:b2PolygonDef= <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">SetAsOrientedBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">3</span>, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">2</span>, <span style="color: #000000; font-weight: bold;">new</span> b2Vec2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">9</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">density</span> = <span style="color: #cc66cc;color:#800000;">1</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 密度 [kg/m^2]</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxShapeDef.<span style="color: #006600;">restitution</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">75</span>;&nbsp; <span style="color: #808080; font-style: italic;">// 反発係数、通常は0～1</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱を動く物体として作る</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBody = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>boxBodyDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBody.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>boxShapeDef<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; boxBody.<span style="color: #006600;">SetMassFromShapes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">////////////////////////////////////////</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 描画設定</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> debugDraw:b2DebugDraw = <span style="color: #000000; font-weight: bold;">new</span> b2DebugDraw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_sprite</span> = <span style="color: #0066CC;">this</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_drawScale</span> = <span style="color: #cc66cc;color:#800000;">100</span>; <span style="color: #808080; font-style: italic;">// 1mを100ピクセルにする</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_fillAlpha</span> = <span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">6</span>; <span style="color: #808080; font-style: italic;">// 不透明度</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_lineThickness</span> = <span style="color: #cc66cc;color:#800000;">1</span>; <span style="color: #808080; font-style: italic;">// 線の太さ</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debugDraw.<span style="color: #006600;">m_drawFlags</span> = b2DebugDraw.<span style="color: #006600;">e_shapeBit</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world.<span style="color: #006600;">SetDebugDraw</span><span style="color: #66cc66;">&#40;</span>debugDraw<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> enterFrameHandler<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>world == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// Flashはデフォルトで秒間24フレームなので、</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 物理シミュレーションを1/24秒進める</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; world.<span style="color: #006600;">Step</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span> / <span style="color: #cc66cc;color:#800000;">24</span>, <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// 箱の座標、傾きを３D世界に適用する。</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> b2vec:b2Vec2 = boxBody.<span style="color: #006600;">GetPosition</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvView.<span style="color: #006600;">setCubePosition</span><span style="color: #66cc66;">&#40;</span>b2vec.<span style="color: #006600;">x</span> * <span style="color: #cc66cc;color:#800000;">100</span>, b2vec.<span style="color: #006600;">y</span> * <span style="color: #cc66cc;color:#800000;">100</span>, boxBody.<span style="color: #006600;">GetAngle</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
				<p>3D表示用PVViewクラス</p>
				<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">&gt;&gt;text</a></span></div>
				<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
				<div id="actionscript-4">
				<div class="actionscript">
				<ol style="margin:0px; padding:0px" >
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">package src <span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">lights</span>.<span style="color: #006600;">PointLight3D</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">ColorMaterial</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">shadematerials</span>.<span style="color: #006600;">PhongMaterial</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">special</span>.<span style="color: #006600;">CompositeMaterial</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">MaterialsList</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">WireframeMaterial</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">objects</span>.<span style="color: #006600;">primitives</span>.<span style="color: #006600;">Cube</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">view</span>.<span style="color: #006600;">BasicView</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; * ...</span></li>
				<li style="color:#26536A;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; * @author Default</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; */</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PVView <span style="color: #0066CC;">extends</span> BasicView<span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> b2BodyList:<span style="color: #0066CC;">Array</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _light:PointLight3D;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> cube:Cube;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> PVView<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b2BodyList = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span> = -<span style="color: #cc66cc;color:#800000;">50</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">x</span> = -<span style="color: #cc66cc;color:#800000;">40</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">y</span> = -<span style="color: #cc66cc;color:#800000;">40</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _light = <span style="color: #000000; font-weight: bold;">new</span> PointLight3D;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _light.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _light.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _light.<span style="color: #006600;">z</span> = <span style="color: #cc66cc;color:#800000;">40</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> colorMaterial:ColorMaterial = <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #66cc66;">&#40;</span>0x77FF77, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> wireMaterial:WireframeMaterial = <span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0x66FF66, <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> phongMaterial:PhongMaterial = <span style="color: #000000; font-weight: bold;">new</span> PhongMaterial<span style="color: #66cc66;">&#40;</span> _light, 0xCCDDCC, 0xDDEEDD, <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> compositeMaterial:CompositeMaterial = <span style="color: #000000; font-weight: bold;">new</span> CompositeMaterial<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compositeMaterial.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span>colorMaterial<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compositeMaterial.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span>phongMaterial<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compositeMaterial.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span>wireMaterial<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> materialsList:MaterialsList = <span style="color: #000000; font-weight: bold;">new</span> MaterialsList;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; materialsList.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span>compositeMaterial, <span style="color: #ff0000;">"all"</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube = <span style="color: #000000; font-weight: bold;">new</span> Cube<span style="color: #66cc66;">&#40;</span>materialsList, <span style="color: #cc66cc;color:#800000;">60</span>, <span style="color: #cc66cc;color:#800000;">40</span>, <span style="color: #cc66cc;color:#800000;">40</span><span style="color: #66cc66;">&#41;</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;color:#800000;">2</span>.<span style="color: #cc66cc;color:#800000;">5</span> * <span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;color:#800000;">1</span> * <span style="color: #cc66cc;color:#800000;">100</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>cube<span style="color: #66cc66;">&#41;</span>;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startRendering<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; </li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setCubePosition<span style="color: #66cc66;">&#40;</span>x:<span style="color: #0066CC;">Number</span>, y:<span style="color: #0066CC;">Number</span>, rotationY<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube.<span style="color: #006600;">x</span> = x;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube.<span style="color: #006600;">z</span> = y;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rotationY = rotationY * <span style="color: #cc66cc;color:#800000;">180</span>;</li>
				<li style="color:#26536A;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cube.<span style="color: #006600;">rotationY</span> = rotationY;</li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="color:#26536A;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></li>
				<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><span style="color: #66cc66;">&#125;</span> </li>
				</ol>
				</div>
				</div>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://parpue.net/web/138/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

