<?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>YAIMO BLOG &#187; Material</title>
	<atom:link href="http://blog.yaimo.net/category/papervision3d/material/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yaimo.net</link>
	<description>会津の大食いFlasher!!　WordPress, iPhone, Progression, FlashDevelop他</description>
	<lastBuildDate>Thu, 29 Jul 2010 12:26:10 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Papervision3d　はじめの13歩 Material particleMaterial</title>
		<link>http://blog.yaimo.net/2009/06/24/669/</link>
		<comments>http://blog.yaimo.net/2009/06/24/669/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:30:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Material]]></category>
		<category><![CDATA[Papervision3d]]></category>

		<guid isPermaLink="false">http://blog.yaimo.net/?p=669</guid>
		<description><![CDATA[particleMaterialのBitmapバージョン BitmapParticleMaterial -> ParticleMaterial を継承 A Particle material that is made from BitmapData object 参考:http://wonderfl.net/code/0688c09a8c7f1400f72b89ffdf41954bb1284ed9 BitmapParticleMaterial(bitmap:BitmapData) こんな感じに使えばおｋ private var field:ParticleField; var mat2:BitmapParticleMaterial = new BitmapParticleMaterial&#40;target.bitmapData &#41;; //mat2.doubleSided = true; field = new ParticleField&#40;mat2, 50, 1, 1000, 1000, 1000&#41;; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [...]]]></description>
			<content:encoded><![CDATA[<div>
particleMaterialのBitmapバージョン<br />
BitmapParticleMaterial -> ParticleMaterial を継承<br />
 A Particle material that is made from BitmapData object  <br />
<br />
参考<a href="http://wonderfl.net/code/0688c09a8c7f1400f72b89ffdf41954bb1284ed9">:http://wonderfl.net/code/0688c09a8c7f1400f72b89ffdf41954bb1284ed9</a><br />
<br />
BitmapParticleMaterial(bitmap:BitmapData)<br />
<br />
<a  rel="shadowbox;width=640;height=480" href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/TestSample5.swf"><img src="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/12.png" alt="" /></a><br />
<br />
<br />
こんな感じに使えばおｋ<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> field<span style="color: #000000; font-weight: bold;">:</span>ParticleField;
<span style="color: #6699cc; font-weight: bold;">var</span> mat2<span style="color: #000000; font-weight: bold;">:</span>BitmapParticleMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapParticleMaterial<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span>.<span style="color: #004993;">bitmapData</span> <span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">//mat2.doubleSided = true;</span>
field = <span style="color: #0033ff; font-weight: bold;">new</span> ParticleField<span style="color: #000000;">&#40;</span>mat2, <span style="color: #000000; font-weight:bold;">50</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1000</span>, <span style="color: #000000; font-weight:bold;">1000</span>, <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<br />
<br />
<span id="more-669"></span><br />
<br />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.special.BitmapParticleMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.special.ParticleMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.special.ParticleField;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">BitmapData</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Bitmap</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">DisplayObject</span>;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0x000000&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span> 
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> basicview<span style="color: #000000; font-weight: bold;">:</span>BasicView;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> field<span style="color: #000000; font-weight: bold;">:</span>ParticleField;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// entry point</span>
			basicview = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>, <span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> mat<span style="color: #000000; font-weight: bold;">:</span>ParticleMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ParticleMaterial<span style="color: #000000;">&#40;</span>0x00FF40, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;img/test1.jpg&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>, compHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> enterFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			field.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			field.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			field.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> compHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span> = e.<span style="color: #004993;">target</span>.<span style="color: #004993;">content</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Bitmap</span>;
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span>.<span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> mat<span style="color: #000000; font-weight: bold;">:</span>ParticleMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ParticleMaterial<span style="color: #000000;">&#40;</span>0x00FF00, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> mat2<span style="color: #000000; font-weight: bold;">:</span>BitmapParticleMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapParticleMaterial<span style="color: #000000;">&#40;</span><span style="color: #004993;">target</span>.<span style="color: #004993;">bitmapData</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">//mat2.doubleSided = true;</span>
&nbsp;
			field = <span style="color: #0033ff; font-weight: bold;">new</span> ParticleField<span style="color: #000000;">&#40;</span>mat2, <span style="color: #000000; font-weight:bold;">50</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1000</span>, <span style="color: #000000; font-weight:bold;">1000</span>, <span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
			basicview.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>field<span style="color: #000000;">&#41;</span>;
			basicview.startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>basicview<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, enterFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<br />
<br />
</div>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.yaimo.net/2009/05/16/424/" title="Papervision3d　はじめの四歩 マウスイベント (2009 年 5 月 16 日)">Papervision3d　はじめの四歩 マウスイベント</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/29/458/" title="Papervision3d　はじめの六歩 Camera について学ぶ。 (2009 年 5 月 29 日)">Papervision3d　はじめの六歩 Camera について学ぶ。</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/22/441/" title="Papervision3d　はじめの五歩 BasicView に頼らない (2009 年 5 月 22 日)">Papervision3d　はじめの五歩 BasicView に頼らない</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/08/363/" title="Papervision3d　はじめの二歩 (2009 年 5 月 8 日)">Papervision3d　はじめの二歩</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/15/402/" title="Papervision3d　はじめの三歩 テクスチャ(3) (2009 年 5 月 15 日)">Papervision3d　はじめの三歩 テクスチャ(3)</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.yaimo.net/2009/06/24/669/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3d　はじめの12歩 Material BitmapViewport3D</title>
		<link>http://blog.yaimo.net/2009/06/18/576/</link>
		<comments>http://blog.yaimo.net/2009/06/18/576/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 06:55:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Material]]></category>
		<category><![CDATA[Papervision3d]]></category>

		<guid isPermaLink="false">http://blog.yaimo.net/?p=576</guid>
		<description><![CDATA[なかなか思うように移すのがむずかすぃ。 Viewportの幅と、高さ同じにしてPlaneの大きさも同じにしたはずだけど小さくなった。 なぜなぜ？ 登録の仕方として2つ方法で試してみた！ BasicViewを使用する方法 BasicViewを使用しない方法(BasicViewを継承したクラスじゃないと出来ないっぽいので１推奨かな。) BasicViewを使用する方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 [...]]]></description>
			<content:encoded><![CDATA[<div>
なかなか思うように移すのがむずかすぃ。<br />
<br />
Viewportの幅と、高さ同じにしてPlaneの大きさも同じにしたはずだけど小さくなった。<br />
なぜなぜ？<br />
<br />
登録の仕方として2つ方法で試してみた！<br />
<ol>
	<li>BasicViewを使用する方法</li>
<br />
	<li>BasicViewを使用しない方法(BasicViewを継承したクラスじゃないと出来ないっぽいので１推奨かな。)</li>
</ol>
<br />
<a  rel="shadowbox;width=640;height=480" href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/TestSample.swf"><img src="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/bitmaterial.png" alt="" /></a><br />
<br />
<span id="more-576"></span><br />
BasicViewを使用する方法<br />
<br />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.cameras.Camera3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.<span style="color: #004993;">render</span>.BasicRenderEngine;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.<span style="color: #004993;">scenes</span>.Scene3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BitmapViewport3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.Viewport3D;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0x000000&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span> 
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> colopPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bmpviewPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">render</span><span style="color: #000000; font-weight: bold;">:</span>BasicRenderEngine;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> scene<span style="color: #000000; font-weight: bold;">:</span>Scene3D;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> camera<span style="color: #000000; font-weight: bold;">:</span>Camera3D;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> viewport<span style="color: #000000; font-weight: bold;">:</span>Viewport3D;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bitmapViewprot<span style="color: #000000; font-weight: bold;">:</span>BitmapViewport3D;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
&nbsp;
			viewport = <span style="color: #0033ff; font-weight: bold;">new</span> Viewport3D<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>,<span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			camera = <span style="color: #0033ff; font-weight: bold;">new</span> Camera3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			scene = <span style="color: #0033ff; font-weight: bold;">new</span> Scene3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">render</span> = <span style="color: #0033ff; font-weight: bold;">new</span> BasicRenderEngine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>viewport<span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> colorMaterial<span style="color: #000000; font-weight: bold;">:</span>ColorMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ColorMaterial<span style="color: #000000;">&#40;</span>0xFF8000, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			colorMaterial.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			colorMaterial.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			colopPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>colorMaterial, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			colopPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">500</span>;
			colopPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">300</span>;
&nbsp;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colopPlane<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #3f5fbf;">/*** BitmapViewport設定 ***/</span>
			bitmapViewprot = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapViewport3D<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>,<span style="color: #000000; font-weight:bold;">480</span>,<span style="color: #0033ff; font-weight: bold;">false</span>,<span style="color: #0033ff; font-weight: bold;">false</span>,0xFFFF00<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> bitmapViewMat<span style="color: #000000; font-weight: bold;">:</span>BitmapViewportMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapViewportMaterial<span style="color: #000000;">&#40;</span>bitmapViewprot<span style="color: #000000;">&#41;</span>;
			bmpviewPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>bitmapViewMat, <span style="color: #000000; font-weight:bold;">640</span>, <span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			bmpviewPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">200</span>;
			bmpviewPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">200</span>;
&nbsp;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bmpviewPlane<span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, onFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
&nbsp;
			colopPlane.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			colopPlane.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
			colopPlane.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">6</span>;
&nbsp;
			<span style="color: #004993;">render</span>.renderScene<span style="color: #000000;">&#40;</span>scene, camera, viewport<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">render</span>.renderScene<span style="color: #000000;">&#40;</span>scene, camera, bitmapViewprot <span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<br />
<br />
BasicViewを使用しない方法<br />
<br />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.cameras.Camera3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.<span style="color: #004993;">render</span>.BasicRenderEngine;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.<span style="color: #004993;">scenes</span>.Scene3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BitmapViewport3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.Viewport3D;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0x000000&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main2 extends BasicView
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> colopPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bmpviewPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bitmapViewprot<span style="color: #000000; font-weight: bold;">:</span>BitmapViewport3D;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bmscene<span style="color: #000000; font-weight: bold;">:</span>Scene3D;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main2<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> colorMaterial<span style="color: #000000; font-weight: bold;">:</span>ColorMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ColorMaterial<span style="color: #000000;">&#40;</span>0xFF8000, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			colorMaterial.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			colorMaterial.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			colopPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>colorMaterial, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			colopPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">500</span>;
			colopPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">300</span>;
&nbsp;
&nbsp;
			<span style="color: #3f5fbf;">/*** BitmapViewport設定 ***/</span>
			bitmapViewprot = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapViewport3D<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>,<span style="color: #000000; font-weight:bold;">480</span>,<span style="color: #0033ff; font-weight: bold;">false</span>,<span style="color: #0033ff; font-weight: bold;">false</span>,0xFFFF00<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> bitmapViewMat<span style="color: #000000; font-weight: bold;">:</span>BitmapViewportMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapViewportMaterial<span style="color: #000000;">&#40;</span>bitmapViewprot<span style="color: #000000;">&#41;</span>;
			bmpviewPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>bitmapViewMat, <span style="color: #000000; font-weight:bold;">640</span>, <span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			bmpviewPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">200</span>;
			bmpviewPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">200</span>;
&nbsp;
			<span style="color: #3f5fbf;">/*** basicView ***/</span>
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colopPlane<span style="color: #000000;">&#41;</span>;
			scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bmpviewPlane<span style="color: #000000;">&#41;</span>;
			startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">test</span><span style="color: #000000; font-weight: bold;">:</span>BasicView = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
&nbsp;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, onFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> onRenderTick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span>=<span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.renderer.renderScene<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.scene, <span style="color: #0033ff; font-weight: bold;">this</span>.camera, <span style="color: #0033ff; font-weight: bold;">this</span>.bitmapViewprot<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">super</span>.onRenderTick<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
&nbsp;
			colopPlane.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			colopPlane.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
			colopPlane.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">6</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<br />
<br />
</div>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.yaimo.net/2009/05/16/424/" title="Papervision3d　はじめの四歩 マウスイベント (2009 年 5 月 16 日)">Papervision3d　はじめの四歩 マウスイベント</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/29/458/" title="Papervision3d　はじめの六歩 Camera について学ぶ。 (2009 年 5 月 29 日)">Papervision3d　はじめの六歩 Camera について学ぶ。</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/22/441/" title="Papervision3d　はじめの五歩 BasicView に頼らない (2009 年 5 月 22 日)">Papervision3d　はじめの五歩 BasicView に頼らない</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/08/363/" title="Papervision3d　はじめの二歩 (2009 年 5 月 8 日)">Papervision3d　はじめの二歩</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/15/402/" title="Papervision3d　はじめの三歩 テクスチャ(3) (2009 年 5 月 15 日)">Papervision3d　はじめの三歩 テクスチャ(3)</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.yaimo.net/2009/06/18/576/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3d　はじめの11歩 Material BitmapColorMaterial</title>
		<link>http://blog.yaimo.net/2009/06/17/561/</link>
		<comments>http://blog.yaimo.net/2009/06/17/561/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 11:57:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Material]]></category>
		<category><![CDATA[Papervision3d]]></category>

		<guid isPermaLink="false">http://blog.yaimo.net/?p=561</guid>
		<description><![CDATA[激しくBitmapColorMaterialとColorMaterialの違いがわからなかった。 ぐぐったら以下のエントリーを発見したのでめも。 Papervision3D 1.5 のマテリアル BitmapColorMaterialってどうなのよ どうやらColorMaterialとの違いは 第3引数でinteractiveを設定できない。(プロパティーで設定可能) ColorMaterialが速い Graphics コマンドを BitmapData に drawしている smoothプロパティが設定可能 smoothプロパティはMaterialObject3Dにあるので継承していればその恩恵がうけられるけど、 このプロパティーはBitmapColorMaterial と BitmapWireframeMaterialのみらしい。ほー勉強になるわ。。 smoothプロパティ 1.colorMaterial:false,bmpColorMaterial:false デモ 2.colorMaterial:false,bmpColorMaterial:true デモ 3.colorMaterial:true,bmpColorMaterial:true デモ package &#123; import org.papervision3d.materials.BitmapColorMaterial; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.view.BasicView; import flash.events.Event; import flash.display.Sprite; import flash.display.*; &#160; /** * ... * @author yaimo */ &#91;SWF&#40;width = &#34;640&#34;, height = [...]]]></description>
			<content:encoded><![CDATA[<div>
激しくBitmapColorMaterialとColorMaterialの違いがわからなかった。<br />
ぐぐったら以下のエントリーを発見したのでめも。<br />
<ul>
	<li><a href="http://aquioux.blog48.fc2.com/blog-entry-239.html#more">Papervision3D 1.5 のマテリアル</a></li>
	<li><a href="http://blog.r3c7.net/?p=84">BitmapColorMaterialってどうなのよ</a></li>
</ul>
どうやらColorMaterialとの違いは<br />
<ol>
	<li>第3引数でinteractiveを設定できない。(プロパティーで設定可能)</li>
<br />
	<li>ColorMaterialが速い</li>
<br />
	<li>Graphics コマンドを BitmapData に drawしている</li>
<br />
	<li>smoothプロパティが設定可能</li>
</ol>
<br />
smoothプロパティはMaterialObject3Dにあるので継承していればその恩恵がうけられるけど、<br />
このプロパティーはBitmapColorMaterial と BitmapWireframeMaterialのみらしい。ほー勉強になるわ。。<br />
smoothプロパティ<br />
1.colorMaterial:false,bmpColorMaterial:false <a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/TestSample1.swf" rel="shadowbox[post-561];width=640;height=385;"> デモ</a><br />
2.colorMaterial:false,bmpColorMaterial:true <a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/TestSample2.swf" rel="shadowbox[post-561];width=640;height=385;"> デモ</a><br />
3.colorMaterial:true,bmpColorMaterial:true <a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/TestSample3.swf" rel="shadowbox[post-561];width=640;height=385;"> デモ</a><br />
<br />
<br />
<span id="more-561"></span><br />
<br />

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.BitmapColorMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.ColorMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Plane;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #000000; font-weight: bold;">*</span>;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * ...
	 * @author yaimo
	 */</span>
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0x000000&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> bmpColorPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> colopPlane<span style="color: #000000; font-weight: bold;">:</span>Plane;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> bmpColorMaterial<span style="color: #000000; font-weight: bold;">:</span>BitmapColorMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapColorMaterial<span style="color: #000000;">&#40;</span>0xFF0080, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			bmpColorMaterial.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> colorMaterial<span style="color: #000000; font-weight: bold;">:</span>ColorMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ColorMaterial<span style="color: #000000;">&#40;</span>0xFF8000, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			colorMaterial.doubleSided = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			<span style="color: #009900;">//DisplayObject3Dで定義されているため使用できるが適用されない</span>
			colorMaterial.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #009900;">//追加</span>
			bmpColorMaterial.smooth = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
			bmpColorPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>bmpColorMaterial, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">400</span>,<span style="color: #000000; font-weight:bold;">1</span>,<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			colopPlane = <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span>colorMaterial, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">400</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			colopPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">200</span>;
			colopPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">200</span>;
&nbsp;
			bmpColorPlane.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">200</span>;
			bmpColorPlane.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">200</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> basicBiew<span style="color: #000000; font-weight: bold;">:</span>BasicView = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			basicBiew.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bmpColorPlane<span style="color: #000000;">&#41;</span>;
			basicBiew.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colopPlane<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>basicBiew<span style="color: #000000;">&#41;</span>;
&nbsp;
			basicBiew.startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, onFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			bmpColorPlane.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			bmpColorPlane.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
			bmpColorPlane.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">6</span>;
&nbsp;
			colopPlane.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span>;
			colopPlane.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
			colopPlane.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">6</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<br />
<br />
</ul>
</li>
</ol></div>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.yaimo.net/2009/05/16/424/" title="Papervision3d　はじめの四歩 マウスイベント (2009 年 5 月 16 日)">Papervision3d　はじめの四歩 マウスイベント</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/29/458/" title="Papervision3d　はじめの六歩 Camera について学ぶ。 (2009 年 5 月 29 日)">Papervision3d　はじめの六歩 Camera について学ぶ。</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/22/441/" title="Papervision3d　はじめの五歩 BasicView に頼らない (2009 年 5 月 22 日)">Papervision3d　はじめの五歩 BasicView に頼らない</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/08/363/" title="Papervision3d　はじめの二歩 (2009 年 5 月 8 日)">Papervision3d　はじめの二歩</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/15/402/" title="Papervision3d　はじめの三歩 テクスチャ(3) (2009 年 5 月 15 日)">Papervision3d　はじめの三歩 テクスチャ(3)</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.yaimo.net/2009/06/17/561/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3d　はじめの9歩 Material ShadedMaterial</title>
		<link>http://blog.yaimo.net/2009/06/07/521/</link>
		<comments>http://blog.yaimo.net/2009/06/07/521/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 09:45:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Material]]></category>
		<category><![CDATA[Papervision3d]]></category>

		<guid isPermaLink="false">http://blog.yaimo.net/?p=521</guid>
		<description><![CDATA[FlatShadeMaterialは、ColorMaterialの陰影つけられる位置づけという感じで捉えたほうがいいのかな？ じゃぁ、BitMapMaterialに陰影つけるにはどーすればいいの！っていう時は、ShadedMaterialを使えばいいらしい。 ShadedMaterial&#40;material:BitmapMaterial, shader:Shader, compositeMode:int = 0&#41; material : BitmapMaterial shader : Shader shaderCompositeMode : int shaderの合成モード Shaderは陰影をつける方法： 第2引数のShaderには色々種類があってこのShaderによって陰影のつき方がかわってくるらしい。 イメージ： 画像データ(BitMapMaterial)+陰影をつける方法(Shader(ライト+影の色の設定)) で作ったマテリアルがShadedMaterialというイメージかな？ メモ： shaderについてはまた今度やろう。なんかこの陰影のつき方はかかり具合が厄介らしい。 セグメントの数と、影の色で色々大変みたいです。 var light:PointLight3D = new PointLight3D&#40;&#41;; var bmpMaterial:BitmapMaterial = BitmapMaterial&#40;new BitmapFileMaterial&#40;&#34;img/test1.jpg&#34;&#41;&#41;; var flatShade:FlatShader = new FlatShader&#40;light, 0x0000FF,0xFF8040&#41;; &#160; var shadedMaterial:ShadedMaterial = new ShadedMaterial&#40;bmpMaterial, flatShade&#41;; var materialsList:MaterialsList = new MaterialsList&#40; &#123; all: [...]]]></description>
			<content:encoded><![CDATA[<div>
FlatShadeMaterialは、ColorMaterialの陰影つけられる位置づけという感じで捉えたほうがいいのかな？<br />
じゃぁ、BitMapMaterialに陰影つけるにはどーすればいいの！っていう時は、ShadedMaterialを使えばいいらしい。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">ShadedMaterial<span style="color: #000000;">&#40;</span>material<span style="color: #000000; font-weight: bold;">:</span>BitmapMaterial, shader<span style="color: #000000; font-weight: bold;">:</span>Shader, compositeMode<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
material <span style="color: #000000; font-weight: bold;">:</span> BitmapMaterial
shader <span style="color: #000000; font-weight: bold;">:</span> Shader
shaderCompositeMode <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span>  shaderの合成モード</pre></div></div>

<br />
Shaderは陰影をつける方法：<br />
第2引数のShaderには色々種類があってこのShaderによって陰影のつき方がかわってくるらしい。<br />
<br />
イメージ：<br />
画像データ(BitMapMaterial)+陰影をつける方法(Shader(ライト+影の色の設定))<br />
で作ったマテリアルがShadedMaterialというイメージかな？<br />
<br />
メモ：<br />
shaderについてはまた今度やろう。なんかこの陰影のつき方はかかり具合が厄介らしい。<br />
セグメントの数と、影の色で色々大変みたいです。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">			<span style="color: #6699cc; font-weight: bold;">var</span> light<span style="color: #000000; font-weight: bold;">:</span>PointLight3D = <span style="color: #0033ff; font-weight: bold;">new</span> PointLight3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> bmpMaterial<span style="color: #000000; font-weight: bold;">:</span>BitmapMaterial = BitmapMaterial<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> BitmapFileMaterial<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;img/test1.jpg&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> flatShade<span style="color: #000000; font-weight: bold;">:</span>FlatShader = <span style="color: #0033ff; font-weight: bold;">new</span> FlatShader<span style="color: #000000;">&#40;</span>light, 0x0000FF,0xFF8040<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> shadedMaterial<span style="color: #000000; font-weight: bold;">:</span>ShadedMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ShadedMaterial<span style="color: #000000;">&#40;</span>bmpMaterial, flatShade<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> materialsList<span style="color: #000000; font-weight: bold;">:</span>MaterialsList = <span style="color: #0033ff; font-weight: bold;">new</span> MaterialsList<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>
				all<span style="color: #000000; font-weight: bold;">:</span> shadedMaterial
			<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			cube = <span style="color: #0033ff; font-weight: bold;">new</span> Cube<span style="color: #000000;">&#40;</span>materialsList, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			sphere = <span style="color: #0033ff; font-weight: bold;">new</span> Sphere<span style="color: #000000;">&#40;</span>shadedMaterial,<span style="color: #000000; font-weight:bold;">200</span>,<span style="color: #000000; font-weight:bold;">20</span>,<span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<br />
<a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/testsample2.swf" rel="shadowbox[post-521];width=640;height=385;"><img src="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/1b.png" alt="" /></a><br />
<span id="more-521"></span><br />
<br />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.lights.PointLight3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.BitmapFileMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.BitmapMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.ColorMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shadematerials.FlatShadeMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shaders.FlatShader;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shaders.ShadedMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Cube;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.utils.MaterialsList;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Sphere;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">BitmapData</span>;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0xFFFFFF&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span> 
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> cube<span style="color: #000000; font-weight: bold;">:</span>Cube;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> sphere<span style="color: #000000; font-weight: bold;">:</span>Sphere;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// entry point</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> light<span style="color: #000000; font-weight: bold;">:</span>PointLight3D = <span style="color: #0033ff; font-weight: bold;">new</span> PointLight3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> bmpMaterial<span style="color: #000000; font-weight: bold;">:</span>BitmapMaterial = BitmapMaterial<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> BitmapFileMaterial<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;img/test1.jpg&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> flatShade<span style="color: #000000; font-weight: bold;">:</span>FlatShader = <span style="color: #0033ff; font-weight: bold;">new</span> FlatShader<span style="color: #000000;">&#40;</span>light, 0xFF0080,0xFF8040<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> shadedMaterial<span style="color: #000000; font-weight: bold;">:</span>ShadedMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> ShadedMaterial<span style="color: #000000;">&#40;</span>bmpMaterial, flatShade<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> materialsList<span style="color: #000000; font-weight: bold;">:</span>MaterialsList = <span style="color: #0033ff; font-weight: bold;">new</span> MaterialsList<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>
				all<span style="color: #000000; font-weight: bold;">:</span> shadedMaterial
				<span style="color: #009900;">//back: new FlatShadeMaterial(light,0x00FFFF),</span>
				<span style="color: #009900;">//right: new FlatShadeMaterial(light,0x800080),</span>
				<span style="color: #009900;">//left: new FlatShadeMaterial(light,0xFFFFFF),</span>
				<span style="color: #009900;">//top: new FlatShadeMaterial(light,0x808000),</span>
				<span style="color: #009900;">//bottom: new FlatShadeMaterial(light,0xFF8000)</span>
			<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			cube = <span style="color: #0033ff; font-weight: bold;">new</span> Cube<span style="color: #000000;">&#40;</span>materialsList, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			sphere = <span style="color: #0033ff; font-weight: bold;">new</span> Sphere<span style="color: #000000;">&#40;</span>shadedMaterial,<span style="color: #000000; font-weight:bold;">200</span>,<span style="color: #000000; font-weight:bold;">20</span>,<span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span>;
			sphere.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">200</span>;
			cube.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">200</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> basicView<span style="color: #000000; font-weight: bold;">:</span>BasicView = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>, <span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			basicView.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>sphere<span style="color: #000000;">&#41;</span>;
			basicView.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>cube<span style="color: #000000;">&#41;</span>;
&nbsp;
			basicView.startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>basicView<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, onFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			cube.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">5</span>;
			cube.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">4</span>;
			cube.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
&nbsp;
			sphere.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">5</span>;
			sphere.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">4</span>;
			sphere.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<br />
<br />
</div>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.yaimo.net/2009/05/16/424/" title="Papervision3d　はじめの四歩 マウスイベント (2009 年 5 月 16 日)">Papervision3d　はじめの四歩 マウスイベント</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/29/458/" title="Papervision3d　はじめの六歩 Camera について学ぶ。 (2009 年 5 月 29 日)">Papervision3d　はじめの六歩 Camera について学ぶ。</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/22/441/" title="Papervision3d　はじめの五歩 BasicView に頼らない (2009 年 5 月 22 日)">Papervision3d　はじめの五歩 BasicView に頼らない</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/08/363/" title="Papervision3d　はじめの二歩 (2009 年 5 月 8 日)">Papervision3d　はじめの二歩</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/15/402/" title="Papervision3d　はじめの三歩 テクスチャ(3) (2009 年 5 月 15 日)">Papervision3d　はじめの三歩 テクスチャ(3)</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.yaimo.net/2009/06/07/521/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3d　はじめの8歩 Material FlatShadeMaterial</title>
		<link>http://blog.yaimo.net/2009/06/06/505/</link>
		<comments>http://blog.yaimo.net/2009/06/06/505/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 08:05:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Material]]></category>
		<category><![CDATA[Papervision3d]]></category>

		<guid isPermaLink="false">http://blog.yaimo.net/?p=505</guid>
		<description><![CDATA[Materialっていっぱいあるなー。。たぶん実践で使えるのはかぎられてくるけども、 あたらしくlightっていうのもでてきた！lightは、光源のために使うっぽい？光の色は設定するのかな？ とりあえず、デフォルトで使用。 光が当たっていればマテリアルの色とオブジェクトの影の色の設定すれば反映される。 とりあえず、わかった所からどんどん潜っていこうという方針なのでまとまりがなくてすみませぬ。 1日１APIをhackを目標に頑張ります。 progressionは今読んでる本が終わってからｗ本格的にやる！ FlatShadeMaterial(light:LightObject3D, lightColor:uint = 0xffffff, ambientColor:uint = 0&#215;000000, specularLevel:uint = 0) light:ライトオブジェクトの設定 lightColor;ライトとが当たっている場所の色、ライトが当たっていない所は影なので黒くなる。 ambientColor:環境光 ライトが当たってないところの影の色をどうするかの設定。デフォルトは黒 specularLevel:〔反射光｛はんしゃこう｝が〕、鏡面反射性｝の度合 ambientなし:左 ambientあり:右 　 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [...]]]></description>
			<content:encoded><![CDATA[<div>
Materialっていっぱいあるなー。。たぶん実践で使えるのはかぎられてくるけども、<br />
あたらしくlightっていうのもでてきた！lightは、光源のために使うっぽい？光の色は設定するのかな？<br />
とりあえず、デフォルトで使用。<br />
光が当たっていればマテリアルの色とオブジェクトの影の色の設定すれば反映される。<br />
とりあえず、わかった所からどんどん潜っていこうという方針なのでまとまりがなくてすみませぬ。<br />
1日１APIをhackを目標に頑張ります。<br />
progressionは今読んでる本が終わってからｗ本格的にやる！<br />
<br />
FlatShadeMaterial(light:LightObject3D, lightColor:uint = 0xffffff, ambientColor:uint = 0&#215;000000, specularLevel:uint = 0)<br />
light:ライトオブジェクトの設定<br />
lightColor;ライトとが当たっている場所の色、ライトが当たっていない所は影なので黒くなる。<br />
ambientColor:環境光 ライトが当たってないところの影の色をどうするかの設定。デフォルトは黒<br />
specularLevel:〔反射光｛はんしゃこう｝が〕、鏡面反射性｝の度合<br />
<br />
ambientなし:左<br />
ambientあり:右<br />
<a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/testsample1.swf" rel="shadowbox[post-505];width=640;height=385;"><img src="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/1d.png" alt="" /></a>　<a href="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/testsample.swf" rel="shadowbox[post-505];width=640;height=385;"><img src="http://blog.yaimo.net/wordpress/wp-content/uploads/2009/06/2d.png" alt="" /></a><br />
<span id="more-505"></span><br />
<br />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> 
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.lights.PointLight3D;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.ColorMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.shadematerials.FlatShadeMaterial;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.objects.primitives.Cube;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.materials.utils.MaterialsList;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.view.BasicView;
&nbsp;
	<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span> = <span style="color: #990000;">&quot;640&quot;</span>, <span style="color: #004993;">height</span> = <span style="color: #990000;">&quot;480&quot;</span>, <span style="color: #004993;">backgroundColor</span> = <span style="color: #990000;">&quot;0xFFFFFF&quot;</span>, <span style="color: #004993;">frameRate</span> = <span style="color: #990000;">&quot;24&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">Sprite</span> 
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> cube<span style="color: #000000; font-weight: bold;">:</span>Cube;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ADDED_TO_STAGE</span>, <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// entry point</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> light<span style="color: #000000; font-weight: bold;">:</span>PointLight3D = <span style="color: #0033ff; font-weight: bold;">new</span> PointLight3D<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> materialsList<span style="color: #000000; font-weight: bold;">:</span>MaterialsList = <span style="color: #0033ff; font-weight: bold;">new</span> MaterialsList<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>
				front<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0xFF0080<span style="color: #000000;">&#41;</span>,
				back<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0x00FFFF<span style="color: #000000;">&#41;</span>,
				<span style="color: #004993;">right</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0x800080<span style="color: #000000;">&#41;</span>,
				<span style="color: #004993;">left</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0xFFFFFF<span style="color: #000000;">&#41;</span>,
				<span style="color: #004993;">top</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0x808000<span style="color: #000000;">&#41;</span>,
				<span style="color: #004993;">bottom</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FlatShadeMaterial<span style="color: #000000;">&#40;</span>light,0xFF8000<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			cube = <span style="color: #0033ff; font-weight: bold;">new</span> Cube<span style="color: #000000;">&#40;</span>materialsList, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">200</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> basicView<span style="color: #000000; font-weight: bold;">:</span>BasicView = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">640</span>, <span style="color: #000000; font-weight:bold;">480</span><span style="color: #000000;">&#41;</span>;
			basicView.scene.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>cube<span style="color: #000000;">&#41;</span>;
			basicView.startRendering<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>basicView<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>, onFrameHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFrameHandler<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> 
		<span style="color: #000000;">&#123;</span>
			cube.rotationX <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">5</span>;
			cube.rotationY <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">4</span>;
			cube.rotationZ <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">3</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<br />
<br />
</div>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.yaimo.net/2009/05/16/424/" title="Papervision3d　はじめの四歩 マウスイベント (2009 年 5 月 16 日)">Papervision3d　はじめの四歩 マウスイベント</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/29/458/" title="Papervision3d　はじめの六歩 Camera について学ぶ。 (2009 年 5 月 29 日)">Papervision3d　はじめの六歩 Camera について学ぶ。</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/22/441/" title="Papervision3d　はじめの五歩 BasicView に頼らない (2009 年 5 月 22 日)">Papervision3d　はじめの五歩 BasicView に頼らない</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/08/363/" title="Papervision3d　はじめの二歩 (2009 年 5 月 8 日)">Papervision3d　はじめの二歩</a></li>
	<li><a href="http://blog.yaimo.net/2009/05/15/402/" title="Papervision3d　はじめの三歩 テクスチャ(3) (2009 年 5 月 15 日)">Papervision3d　はじめの三歩 テクスチャ(3)</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.yaimo.net/2009/06/06/505/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
