<?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>franto.com &#187; Daniel Sedlacek</title>
	<atom:link href="http://franto.com/author/daniel-sedlacek/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com</link>
	<description></description>
	<lastBuildDate>Tue, 23 Aug 2011 10:29:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Inverse masking disclosed</title>
		<link>http://franto.com/inverse-masking-disclosed/</link>
		<comments>http://franto.com/inverse-masking-disclosed/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:50:29 +0000</pubDate>
		<dc:creator>Daniel Sedlacek</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[blending]]></category>
		<category><![CDATA[blendmode]]></category>
		<category><![CDATA[erase]]></category>
		<category><![CDATA[inverse]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[masking]]></category>
		<category><![CDATA[reverse]]></category>

		<guid isPermaLink="false">http://www.franto.com/?p=948</guid>
		<description><![CDATA[Recently I have used inverse mask in my project &#8211; a mask that hides everything beneath it, keeping everything outside visible. I knew there is no direct support for inverse masking in Flash, but such effect can be achieved by using blend modes. To my surprise when you google the term &#8220;flash inverse mask&#8221; all [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Finverse-masking-disclosed%2F&amp;text=Inverse masking disclosed&amp;count=vertical&amp;lang=en&amp;related=alpha,blending,blendmode,erase,inverse,layer,mask,masking,reverse"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>Recently I have used inverse mask in my project &#8211; <strong>a mask that hides everything beneath it, keeping everything outside visible</strong>. I knew there is no direct support for inverse masking in Flash, but such effect can be achieved by using blend modes.</p>
<p>To my surprise when you google the term &#8220;flash inverse mask&#8221; all top ten or so results claim that this is not possible in Flash(!). People either suggest to <em>&#8220;invert the mask&#8221;</em> or <em>&#8220;duplicate the background layer and put it on the top of the layer stack, mask that&#8221;</em>. Some more advanced coders even do some magic with BitmapData.treshold and ColorTransforms. This may work but the solution is way much easier.</p>
<p><span id="more-948"></span><br />
Simply set the blend mode of masking object to BlendMode.ERASE place it above the object you want to mask and set the blend mode of their parent to BlendMode.LAYER (this is essential). And that&#8217;s it! You can get similar effect when your mask is transparent and you project it&#8217;s transparency to underlying object by setting BlendMode.ALPHA.</p>
<p><object id="bt04" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="420" height="315" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="center" /><param name="allowScriptAccess" value="sameDomain" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://www.franto.com/uploads/inverseMask.swf" /><param name="name" value="bt" /><embed id="bt04" type="application/x-shockwave-flash" width="420" height="315" src="http://www.franto.com/uploads/inverseMask.swf" name="bt" bgcolor="#ffffff" scale="noscale" quality="high" menu="false" allowscriptaccess="sameDomain" align="center"></embed></object></p>
<p>It is a pity that such valuable functionality remains almost unknown and unused and I think <strong>Adobe is the one to blame here</strong>. The documentation on blending modes is really poor, if not confusing. Especially the LAYER mode is confusing, stating <em>&#8220;This is done automatically if &#8230;is display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL.&#8221;</em> while the ERASE mode reads <em>&#8220;This requires the blendMode of the parent display object to be set to BlendMode.LAYER&#8221;</em> (manually). I have also noticed that adding shadow to the parent object has the same effect here as setting the blend mode to LAYER. In addition, there are some nice pictures on how different blend modes work, but you won&#8217;t find them (nor a reference) in a <a href="http://livedocs.adobe.com/flash/9.0/main/00000162.html">Applying blending modes</a> chapter, nor in <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BlendMode.html">BlendMode class documentation</a> but only in <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#blendMode">DisplayObject class documentation</a>. To shame Adobe even more, blend modes are available since <em>&#8220;ActionScript 1.0; Flash Player 8&#8243;</em></p>
<p>If this article was of any help to you please lave me a comment <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Download source FLA <a title="inverseMask.fla" href="http://www.franto.com/uploads/inverseMask.fla">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/inverse-masking-disclosed/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>3x creative use of displacement filter</title>
		<link>http://franto.com/3x-creative-use-of-displacement-filter/</link>
		<comments>http://franto.com/3x-creative-use-of-displacement-filter/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 09:57:40 +0000</pubDate>
		<dc:creator>Daniel Sedlacek</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.franto.com/blog2/3x-creative-use-of-displacement-filter</guid>
		<description><![CDATA[I fell in love with DisplacementMapFilter as it first time appeared in Flash 8. All tree demos you see here are remakes of some old AS2 experiments; in AS3 performance should not be such issue &#8211; actually the only performance test I took was when I displaced 800&#215;600 bitmap with itself back in AS2 and [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2F3x-creative-use-of-displacement-filter%2F&amp;text=3x creative use of displacement filter&amp;count=vertical&amp;lang=en"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I fell in love with DisplacementMapFilter as it first time appeared in Flash 8. All tree demos you see here are remakes of some old AS2 experiments; in AS3 performance should not be such issue &#8211; actually the only performance test I took was when I displaced 800&#215;600 bitmap with itself back in AS2 and that was a limit that time; here we use AS3 and we are using much smaller maps.</p>
<p>My tips:</p>
<ul>
<li>I always use red channel when dealing with artificial displacement maps (DisplacementMapFilter.componentX = BitmapDataChannel.RED). The neutral color is then 0&#215;800000 (R:128, G:0, B:0), any brighter or darker (red) color will affect the filter.</li>
<li>To apply filter temporary (you can remove or change it later) pass it to the &#8216;filters&#8217; array of any DisplayObject, to apply it permanently use applyFilter method of appropriate BitmapData object.</li>
</ul>
<p><strong>Wave (ripple) displacement effect</strong></p>
<p>The idea is very simple, I draw wave like gradient, then scale it and apply it as a displacement filter. I hope someone will create more realistic gradient and send me a link <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . In top left corner you can see preview of the displacement map &#8211; the fill color is neutral (0&#215;800000) and the wave is using full red to black gradient.</p>
<p><span id="more-470"></span></p>
<table border="0">
<tbody>
<tr>
<td><object id="bt04" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="420" height="550" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="center" /><param name="allowScriptAccess" value="sameDomain" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://franto.com/uploads/examples/displacement/wavedemo.swf" /><param name="name" value="bt" /><embed id="bt04" type="application/x-shockwave-flash" width="420" height="550" src="http://franto.com/uploads/examples/displacement/wavedemo.swf" name="bt" bgcolor="#ffffff" scale="noscale" quality="high" menu="false" allowscriptaccess="sameDomain" align="center"></embed></object></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><strong>Distort displacement effect</strong></p>
<p>Deform your face! That game is very old but I never realised it is so easy to get similar effect just with displacement filter. Simply rotate the &#8216;scaleX&#8217; and &#8216;scaleY&#8217;  properties to displace selected area to any direction, using soft mound (radial gradient) as displacement map. In top left corner see the displacement map preview.</td>
</tr>
<tr>
<td><object id="bt04" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="420" height="550" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="center" /><param name="allowScriptAccess" value="sameDomain" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://franto.com/uploads/examples/displacement/distortdemo.swf" /><param name="name" value="bt" /><embed id="bt04" type="application/x-shockwave-flash" width="420" height="550" src="http://franto.com/uploads/examples/displacement/distortdemo.swf" name="bt" bgcolor="#ffffff" scale="noscale" quality="high" menu="false" allowscriptaccess="sameDomain" align="center"></embed></object></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><strong>Glassy Button (material with refractive index)</strong></p>
<p>Of course it is just simulation of refractive index, and absolutely unrealistic simulation to be honest, but who cares <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . In this demo I use right tree filter effects: first I get a rounded rectangle shape (the right one on the top) and apply inner glow filter to soften the edges. The result is used as displacement map  (the left one on the top). Then I get another copy of the same shape and apply inner bevel filter with &#8216;knockout&#8217; parameter that hide the shape itself and gives us just the bevel.</p>
<p>Then you can animate the displacement and bevel &#8220;depth&#8221; or even change the shape at runtime. For this demo purpose I drag the button with mouse &#8211; imagine the result achieved if the button will hover above playing video.</td>
</tr>
<tr>
<td><object id="bt04" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="420" height="550" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="center" /><param name="allowScriptAccess" value="sameDomain" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://franto.com/uploads/examples/displacement/buttondemo.swf" /><param name="name" value="bt" /><embed id="bt04" type="application/x-shockwave-flash" width="420" height="550" src="http://franto.com/uploads/examples/displacement/buttondemo.swf" name="bt" bgcolor="#ffffff" scale="noscale" quality="high" menu="false" allowscriptaccess="sameDomain" align="center"></embed></object></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>Download source files <a title="displacementdemos.zip" href="http://franto.com/uploads/examples/displacement/displacementdemos.zip">here</a>.</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>PS: The hot babe is <a title="Sirinx" href="http://en.wikipedia.org/wiki/Syrinx" target="_blank">Syrinx</a> by W. McMillan, Kelvin Groove Museum.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/3x-creative-use-of-displacement-filter/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Cylinder radial segment primitive object for Papervision3D</title>
		<link>http://franto.com/cylinder-radial-segment-primitive-object-for-papervision3d/</link>
		<comments>http://franto.com/cylinder-radial-segment-primitive-object-for-papervision3d/#comments</comments>
		<pubDate>Mon, 19 May 2008 06:59:26 +0000</pubDate>
		<dc:creator>Daniel Sedlacek</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.franto.com/blog2/cylinder-radial-segment-primitive-object-for-papervision3d</guid>
		<description><![CDATA[For my latest project I needed to display 3D cylinder slices - Papervision was an obvious choice. Unfortunately the primitive cylinder class does not work this way, the cylinder is built as a square mesh with no option for segment slices. So I had to help myself, I started to play with the almost undocumented PV3D primitives, step by step modifying the original cylinder class and after couple hours I dig out what is what and derived my RadialSegment class. It follows the original concept with one material for whole object, supports UV mapping and inherit all other properties. Here it is, use it as you wish.]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fcylinder-radial-segment-primitive-object-for-papervision3d%2F&amp;text=Cylinder radial segment primitive object for Papervision3D&amp;count=vertical&amp;lang=en"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>For my latest project I needed to display 3D cylinder slices &#8211; <strong><a href="http://blog.papervision3d.org">Papervision</a></strong> was an obvious choice. Unfortunately the primitive cylinder class does not work this way, the cylinder is built as a square mesh with no option for segment slices. So I had to help myself, I started to play with the almost undocumented PV3D primitives, step by step modifying the original cylinder class and after couple hours I dig out what is what and derived my <strong>RadialSegment class</strong>. It follows the original concept with  one material for whole object, supports UV mapping and inherit all other properties. Here it is, use it as you wish.</p>
<p><img src="http://franto.com/uploads/examples/pie/papervision3d-cylinder-radial-segment1.gif" alt="papervision3d cylinder radial segment" /></p>
<p>Code and live example in full article<br />
<span id="more-446"></span></p>
<p>Here is <a href="http://franto.com/uploads/examples/pie/">live example</a> and <a title="RadialSegment.as" href="http://franto.com/uploads/examples/pie/RadialSegment.as">source code</a> follows:</p>

<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.core.geom.<span style="color: #000000; font-weight: bold;">*</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.core.geom.renderables.Triangle3D;
<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.core.geom.renderables.Vertex3D;
<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.core.math.NumberUV;
<span style="color: #0033ff; font-weight: bold;">import</span> org.papervision3d.core.proto.<span style="color: #000000; font-weight: bold;">*</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* The RadialSegment class lets you create and display cylinders radial segments.
*
&nbsp;
* The RadialSegment is divided in horizontal mesh segments and vertical ragial segments.
*  	 * Derivated from original Cylinder class by Daniel Sedlacek (sedlacek.daniel@gmail.com).
*  	 * Please follow the original Papervision3D license.
*/</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> RadialSegment extends TriangleMesh3D <span style="color: #000000;">&#123;</span>
<span style="color: #3f5fbf;">/**
* Number of segments horizontally. Defaults to 8.
*/</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> segmentsW <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>;		<span style="color: #3f5fbf;">/**
* Number of segments vertically. Defaults to 6.
*/</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> segmentsH <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Default radius of Segment3D if not defined.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> DEFAULT_RADIUS <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">100</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Default height if not defined.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> DEFAULT_HEIGHT <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">50</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Default value of gridX if not defined.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> DEFAULT_SEGMENTSW <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">8</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Default value of gridY if not defined.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> DEFAULT_SEGMENTSH <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">2</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Minimum value of gridX.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> MIN_SEGMENTSW <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">3</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Minimum value of gridY.
*/</span>
static <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> MIN_SEGMENTSH <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">1</span>;
&nbsp;
<span style="color: #3f5fbf;">/**
* Create a new Cylinder object.
*
&nbsp;
* @param	material	[optional] - A MaterialObject3D object that contains the material properties of the object.
*  		 * @param	angle		[optional] - Desired segment angle &amp;lt;0,1&amp;gt;.
*  		 * @param	radius		[optional] - Desired radius.
*  		 * @param	segmentsW	[optional] - Number of segments horizontally. Defaults to 8.
*  		 * @param	segmentsH	[optional] - Number of segments vertically. Defaults to 6.
*  		 * @param	topRadius	[optional] - An optional parameter for con- or diverging cylinders
*  		 * @param	initObject	[optional] - An object that contains user defined properties with which to populate the newly created GeometryObject3D.
*  		 * It includes x, y, z, rotationX, rotationY, rotationZ, scaleX, scaleY scaleZ and a user defined extra object.
*  		 * If extra is not an object, it is ignored. All properties of the extra field are copied into the new instance. The properties specified with extra are publicly available.
*/</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> RadialSegment<span style="color: #000000;">&#40;</span> material <span style="color: #000000; font-weight: bold;">:</span> MaterialObject3D = <span style="color: #0033ff; font-weight: bold;">null</span>, <span style="color: #004993;">angle</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0.25</span>, radius <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">100</span>, <span style="color: #004993;">height</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">100</span>, segmentsW <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">8</span>, segmentsH <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">2</span>, topRadius <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span>, initObject <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Object</span> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span>material, <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #0033ff; font-weight: bold;">null</span>, initObject<span style="color: #000000;">&#41;</span>;			<span style="color: #0033ff; font-weight: bold;">this</span>.segmentsW = <span style="color: #004993;">Math</span>.<span style="color: #004993;">max</span><span style="color: #000000;">&#40;</span>MIN_SEGMENTSW, segmentsW <span style="color: #000000; font-weight: bold;">||</span> DEFAULT_SEGMENTSW<span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">// Defaults to 8</span>
<span style="color: #0033ff; font-weight: bold;">this</span>.segmentsH = <span style="color: #004993;">Math</span>.<span style="color: #004993;">max</span><span style="color: #000000;">&#40;</span>MIN_SEGMENTSH, segmentsH <span style="color: #000000; font-weight: bold;">||</span> DEFAULT_SEGMENTSH<span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">// Defaults to 6</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>radius == <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> radius = DEFAULT_RADIUS;
<span style="color: #009900;">// Defaults to 100</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">height</span> == <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #004993;">height</span> = DEFAULT_HEIGHT;
<span style="color: #009900;">// Defaults to 100</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>topRadius == <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> topRadius = radius;
<span style="color: #009900;">// segment</span>
<span style="color: #004993;">angle</span> = <span style="color: #004993;">angle</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">angle</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">angle</span>;
&nbsp;
buildSegment<span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span>, radius, <span style="color: #004993;">height</span>, topRadius<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> buildSegment<span style="color: #000000;">&#40;</span> fAngle <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>, fRadius <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>, fHeight <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>,  fTopRadius <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</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> matInstance <span style="color: #000000; font-weight: bold;">:</span> MaterialObject3D = material;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> i <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>, j <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> iHor <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #0033ff; font-weight: bold;">this</span>.segmentsW <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> iVer <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #0033ff; font-weight: bold;">this</span>.segmentsH;
<span style="color: #6699cc; font-weight: bold;">var</span> aVertice <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">this</span>.geometry.vertices;
<span style="color: #6699cc; font-weight: bold;">var</span> aFace <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">this</span>.geometry.faces;
<span style="color: #6699cc; font-weight: bold;">var</span> aVtc <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>j = <span style="color: #000000; font-weight:bold;">0</span>;j <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000;">&#40;</span>iVer <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;j<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #009900;">// vertical</span>
<span style="color: #6699cc; font-weight: bold;">var</span> fZ <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = fHeight <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span>j <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">&#40;</span>iVer <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> fHeight <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span>;
<span style="color: #009900;">//-fRadius*Math.cos(fRad1*Math.PI);</span>
<span style="color: #6699cc; font-weight: bold;">var</span> fRds <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = fTopRadius <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>fRadius <span style="color: #000000; font-weight: bold;">-</span> fTopRadius<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">-</span> j <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">&#40;</span>iVer<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">//*Math.sin(fRad1*Math.PI);</span>
<span style="color: #6699cc; font-weight: bold;">var</span> aRow <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> oVtx <span style="color: #000000; font-weight: bold;">:</span> Vertex3D;
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000; font-weight:bold;">0</span>;i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; iHor;i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #009900;">// horizontal</span>
<span style="color: #6699cc; font-weight: bold;">var</span> fRad2 <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #004993;">Number</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">*</span> i <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">&#40;</span>iHor <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> fX <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = fRds <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">sin</span><span style="color: #000000;">&#40;</span>fRad2 <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span> <span style="color: #000000; font-weight: bold;">*</span> fAngle<span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> fY <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = fRds <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span>fRad2 <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span> <span style="color: #000000; font-weight: bold;">*</span> fAngle<span style="color: #000000;">&#41;</span>;
oVtx = <span style="color: #0033ff; font-weight: bold;">new</span> Vertex3D<span style="color: #000000;">&#40;</span>fY, fZ, fX<span style="color: #000000;">&#41;</span>;
&nbsp;
aVertice.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>oVtx<span style="color: #000000;">&#41;</span>;
aRow.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>oVtx<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900;">// special middle vertex</span>
oVtx = <span style="color: #0033ff; font-weight: bold;">new</span> Vertex3D<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, fZ, <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
aVertice.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>oVtx<span style="color: #000000;">&#41;</span>;
aRow.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>oVtx<span style="color: #000000;">&#41;</span>;
&nbsp;
aVtc.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>aRow<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> iVerNum <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = aVtc.<span style="color: #004993;">length</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> aP4uv <span style="color: #000000; font-weight: bold;">:</span> NumberUV, aP1uv <span style="color: #000000; font-weight: bold;">:</span> NumberUV, aP2uv <span style="color: #000000; font-weight: bold;">:</span> NumberUV, aP3uv <span style="color: #000000; font-weight: bold;">:</span> NumberUV;
<span style="color: #6699cc; font-weight: bold;">var</span> aP1 <span style="color: #000000; font-weight: bold;">:</span> Vertex3D, aP2 <span style="color: #000000; font-weight: bold;">:</span> Vertex3D, aP3 <span style="color: #000000; font-weight: bold;">:</span> Vertex3D, aP4 <span style="color: #000000; font-weight: bold;">:</span> Vertex3D;
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>j = <span style="color: #000000; font-weight:bold;">0</span>;j <span style="color: #000000; font-weight: bold;">&amp;</span>lt; iVerNum;j<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> iHorNum <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span>.<span style="color: #004993;">length</span>;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000; font-weight:bold;">0</span>;i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; iHorNum;i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>j <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; i <span style="color: #000000; font-weight: bold;">&amp;</span>gt;= <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #009900;">// select vertices</span>
<span style="color: #6699cc; font-weight: bold;">var</span> bEnd <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span> = i == <span style="color: #000000;">&#40;</span>iHorNum <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
aP1 = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>bEnd <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">:</span> i<span style="color: #000000;">&#93;</span>;
aP2 = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#40;</span>i == <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">?</span> iHorNum <span style="color: #000000; font-weight: bold;">:</span> i<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
aP3 = aVtc<span style="color: #000000;">&#91;</span>j <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#40;</span>i == <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">?</span> iHorNum <span style="color: #000000; font-weight: bold;">:</span> i<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
aP4 = aVtc<span style="color: #000000;">&#91;</span>j <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>bEnd <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">:</span> i<span style="color: #000000;">&#93;</span>;
<span style="color: #009900;">// uv</span>
<span style="color: #6699cc; font-weight: bold;">var</span> fJ0 <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = j <span style="color: #000000; font-weight: bold;">/</span> iVerNum;
<span style="color: #6699cc; font-weight: bold;">var</span> fJ1 <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span>j <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> iVerNum;
<span style="color: #6699cc; font-weight: bold;">var</span> fI0 <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span>i <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> iHorNum;
<span style="color: #6699cc; font-weight: bold;">var</span> fI1 <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = i <span style="color: #000000; font-weight: bold;">/</span> iHorNum;
aP4uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span>fI0, fJ1<span style="color: #000000;">&#41;</span>;
aP1uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span>fI0, fJ0<span style="color: #000000;">&#41;</span>;
aP2uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span>fI1, fJ0<span style="color: #000000;">&#41;</span>;
aP3uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span>fI1, fJ1<span style="color: #000000;">&#41;</span>;
&nbsp;
aFace.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> Triangle3D<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>, <span style="color: #000000;">&#91;</span>aP1,aP2,aP3<span style="color: #000000;">&#93;</span>, matInstance, <span style="color: #000000;">&#91;</span>aP1uv,aP2uv,aP3uv<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
aFace.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> Triangle3D<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>, <span style="color: #000000;">&#91;</span>aP1,aP3,aP4<span style="color: #000000;">&#93;</span>, matInstance, <span style="color: #000000;">&#91;</span>aP1uv,aP3uv,aP4uv<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>j == <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000; font-weight: bold;">||</span> j == <span style="color: #000000;">&#40;</span>iVerNum <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000; font-weight:bold;">0</span>;i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000;">&#40;</span>iHorNum <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #009900;">// uv</span>
&nbsp;
aP1 = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>iHorNum <span style="color: #000000; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
aP2 = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>;
aP3 = aVtc<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>i <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> bTop <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span> = j == <span style="color: #000000; font-weight:bold;">0</span>;
aP1uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span>aP1.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>, aP1.z <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>;
aP2uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span>aP2.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>, aP2.z <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>;
aP3uv = <span style="color: #0033ff; font-weight: bold;">new</span> NumberUV<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>bTop <span style="color: #000000; font-weight: bold;">?</span> <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span>aP3.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>, aP3.z <span style="color: #000000; font-weight: bold;">/</span> fRadius <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">+</span> .5<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// face</span>
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>j == <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>	aFace.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> Triangle3D<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>, <span style="color: #000000;">&#91;</span>aP1,aP3,aP2<span style="color: #000000;">&#93;</span>, matInstance, <span style="color: #000000;">&#91;</span>aP1uv,aP3uv,aP2uv<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">else</span>		aFace.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> Triangle3D<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>, <span style="color: #000000;">&#91;</span>aP1,aP2,aP3<span style="color: #000000;">&#93;</span>, matInstance, <span style="color: #000000;">&#91;</span>aP1uv,aP2uv,aP3uv<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0033ff; font-weight: bold;">this</span>.geometry.ready = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://franto.com/cylinder-radial-segment-primitive-object-for-papervision3d/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

