

<?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>cwwang.com &#187; C</title>
	<atom:link href="http://cwwang.com/category/software/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwwang.com</link>
	<description>Che-Wei Wang</description>
	<lastBuildDate>Sat, 06 Nov 2010 15:58:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Feedback Playback 2</title>
		<link>http://cwwang.com/2008/05/10/feedback-playback-2/</link>
		<comments>http://cwwang.com/2008/05/10/feedback-playback-2/#comments</comments>
		<pubDate>Sun, 11 May 2008 03:25:55 +0000</pubDate>
		<dc:creator>che-wei wang</dc:creator>
				<category><![CDATA[2D Graphics]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Media Change]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Work in Progress]]></category>

		<guid isPermaLink="false">http://cwwang.com/?p=757</guid>
		<description><![CDATA[FeedBack PlayBack is a dynamic film re-editing and viewing system. The users&#8217; physical state determines the visceral quality of scenes displayed; immediate reactions to the scenes feed back to generate a cinematic crescendo or a lull. We use material that is rigorously narrative, formulaic, and plentiful: the action movie series Die Hard, starring Bruce Willis. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cwwang.com/wordpress/wp-content/uploads/dhpicture-9.png" rel="lightbox[757]" title="dhpicture-9" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/dhpicture-9.thumbnail.png" alt="dhpicture-9" width="128" height="80" class="attachment wp-att-776 " /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/dhpicture-7.png" rel="lightbox[757]" title="dhpicture-7" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/dhpicture-7.thumbnail.png" alt="dhpicture-7" width="128" height="80" class="attachment wp-att-775 " /></a></p>
<p><a href="http://cwwang.com/wordpress/wp-content/uploads/fb-1-352009.png" rel="lightbox[757]" title="fb-1-352009" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/fb-1-352009.thumbnail.png" alt="fb-1-352009" width="128" height="80" class="attachment wp-att-1031 " /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/fb-2-352009.png" rel="lightbox[757]" title="fb-2-352009" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/fb-2-352009.thumbnail.png" alt="fb-2-352009" width="128" height="80" class="attachment wp-att-1032 " /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/fb-3-352009.png" rel="lightbox[757]" title="fb-3-352009" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/fb-3-352009.thumbnail.png" alt="fb-3-352009" width="128" height="80" class="attachment wp-att-1033 " /></a></p>
<p><strong>FeedBack PlayBack</strong> is a dynamic film re-editing and viewing system. The users&#8217; physical state determines the visceral quality of scenes displayed; immediate reactions to the scenes feed back to generate a cinematic crescendo or a lull. We use material that is rigorously narrative, formulaic, and plentiful: the action movie series Die Hard, starring Bruce Willis. A narrative sequence key breaks any given Die Hard movie into narrative elements, corresponding clips were collected from each of the Die Hard movies. Individual clips fall into high, medium, and low action/arousal categories. The user is seated, and places his or her hands on a Galvanic Skin Response (GSR) detection panel (GSR readings are the same kind of data collected in lie detector test). After calibration, the movie begins showing, and clips are displayed depending on the user&#8217;s level of arousal and engagement. The narrative sequence is maintained, though the clips are pulled from any of the movies.<br />
<span id="more-757"></span></p>
<p>In FeedBack PlayBack, the cinematic converges with the physical present, exploiting the power of fiction to manipulate and alter our state of being at the most basic, primal level. We attempt to synchronize the media and viewer&#8211; whether towards a static loop or a explosive climax.</p>
<p>Special thanks to Matt Parker, Die Hard movie expert consultant.</p>
<p>Feedbak Playback is by <a href="http://zannahbot.com/">Zannah Marsh</a> and Che-Wei Wang</p>
]]></content:encoded>
			<wfw:commentRss>http://cwwang.com/2008/05/10/feedback-playback-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comp Form: CFOF</title>
		<link>http://cwwang.com/2007/12/30/comp-form-cfof/</link>
		<comments>http://cwwang.com/2007/12/30/comp-form-cfof/#comments</comments>
		<pubDate>Mon, 31 Dec 2007 01:21:53 +0000</pubDate>
		<dc:creator>che-wei wang</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Comp Form]]></category>
		<category><![CDATA[ITP]]></category>
		<category><![CDATA[openFrameworks]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Work in Progress]]></category>

		<guid isPermaLink="false">http://cwwang.com/2007/12/30/comp-form-cfof/</guid>
		<description><![CDATA[CFOF is an audio to visual translator that maps audio frequencies and volume onto a minimal surface (Catalan&#8217;s Surface). Audio history is viualized and recorded onto the outer rings and move towards the center over time. The overall geometry is also affected by the audio input as high frequencies adjust parameters to expand the Catalan&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-4.png" title="cfof02_picture-4.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-4.thumbnail.png" alt="cfof02_picture-4.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-5.png" title="cfof02_picture-5.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-5.thumbnail.png" alt="cfof02_picture-5.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-6.png" title="cfof02_picture-6.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-6.thumbnail.png" alt="cfof02_picture-6.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-7.png" title="cfof02_picture-7.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-7.thumbnail.png" alt="cfof02_picture-7.png" class="imageframe" height="80" width="128" /></a></p>
<p><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-8.png" title="cfof02_picture-8.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-8.thumbnail.png" alt="cfof02_picture-8.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-9.png" title="cfof02_picture-9.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-9.thumbnail.png" alt="cfof02_picture-9.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-10.png" title="cfof02_picture-10.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-10.thumbnail.png" alt="cfof02_picture-10.png" class="imageframe" height="80" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-11.png" title="cfof02_picture-11.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-11.thumbnail.png" alt="cfof02_picture-11.png" class="imageframe" height="80" width="128" /></a></p>
<p><a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-12.png" title="cfof02_picture-12.png" rel="lightbox[531]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/cfof02_picture-12.thumbnail.png" alt="cfof02_picture-12.png" class="imageframe" height="80" width="128" /></a></p>
<p>CFOF is an audio to visual translator that maps audio frequencies and volume onto a minimal surface  (<a href="http://mathworld.wolfram.com/CatalansSurface.html">Catalan&#8217;s Surface</a>).</p>
<p><span id="more-531"></span>Audio history is viualized and recorded onto the outer rings and move towards the center over time. The overall geometry is also affected by the audio input as high frequencies adjust parameters to expand the Catalan&#8217;s surface, while low pitches do the opposite.  Real-time frequencies and volume are displayed as ripples in across the entire surface.</p>
<p>Download: <a href="http://cwwang.com/wordpress/wp-content/uploads/cfof02app.zip" title="cfof02app.zip">cfof02app.zip</a> (mac)</p>
]]></content:encoded>
			<wfw:commentRss>http://cwwang.com/2007/12/30/comp-form-cfof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grass Type</title>
		<link>http://cwwang.com/2007/10/28/grass/</link>
		<comments>http://cwwang.com/2007/10/28/grass/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 19:32:02 +0000</pubDate>
		<dc:creator>che-wei wang</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Comp Form]]></category>
		<category><![CDATA[ITP]]></category>
		<category><![CDATA[Parametric Modeling]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://cwwang.com/wordpress/2007/10/28/grass/</guid>
		<description><![CDATA[Grass Type is a virtual grass mat. Mouse movements send waves of wind across the grass, erasing the imprinted text which then slowly reappears over time as the wind dies down. (developed with Tim Stutts) Download grasstextapp.zip GrassTypeAdobe.app.zip (for Macs written in C and openGL). Installation]]></description>
			<content:encoded><![CDATA[<p><a href="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-2.png" title="grasspicture-2.png" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-2.thumbnail.png" alt="grasspicture-2.png" class="imageframe" height="96" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-5.png" title="grasspicture-5.png" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-5.thumbnail.png" alt="grasspicture-5.png" class="imageframe" height="96" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-6.png" title="grasspicture-6.png" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-6.thumbnail.png" alt="grasspicture-6.png" class="imageframe" height="96" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-4.png" title="grasspicture-4.png" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/grasspicture-4.thumbnail.png" alt="grasspicture-4.png" class="imageframe" height="96" width="128" /></a></p>
<p>Grass Type is a virtual grass mat. Mouse movements send waves of wind across the grass, erasing the imprinted text which then slowly reappears over time as the wind dies down. (developed with <a href="http://timstutts.com">Tim Stutts</a>)</p>
<p>Download <strike>grasstextapp.zip</strike> <a href="http://cwwang.com/wordpress/wp-content/uploads/GrassTypeAdobe.app.zip" title="GrassTypeAdobe.app.zip">GrassTypeAdobe.app.zip</a> (for Macs written in C and openGL).</p>
<p><span id="more-371"></span><strong>Installation</strong><br />
<a href="http://cwwang.com/wordpress/wp-content/uploads/dsc00056.jpg" title="dsc00056.jpg" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/dsc00056.thumbnail.jpg" alt="dsc00056.jpg" class="imageframe" height="85" width="128" /></a><a href="http://cwwang.com/wordpress/wp-content/uploads/dsc00057.jpg" title="dsc00057.jpg" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/dsc00057.thumbnail.jpg" alt="dsc00057.jpg" class="imageframe" height="85" width="128" /></a></p>
<p><a href="http://cwwang.com/wordpress/wp-content/uploads/img_0563.jpg" title="img_0563.jpg" rel="lightbox[371]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/img_0563.thumbnail.jpg" alt="img_0563.jpg" class="imageframe" height="96" width="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://cwwang.com/2007/10/28/grass/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Grass: Brush</title>
		<link>http://cwwang.com/2007/10/19/grass-brush/</link>
		<comments>http://cwwang.com/2007/10/19/grass-brush/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 07:08:04 +0000</pubDate>
		<dc:creator>che-wei wang</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Comp Form]]></category>
		<category><![CDATA[ITP]]></category>
		<category><![CDATA[Work in Progress]]></category>

		<guid isPermaLink="false">http://cwwang.com/wordpress/2007/10/19/grass-brush/</guid>
		<description><![CDATA[A small step towards realistic grass in openGL and C. Grass responds to &#8220;petting&#8221; via mouse control. //grass # define nBlades 30000 int randomX[nBlades]; int randomY[nBlades]; int randomHeight[nBlades]; float randomWindVelocity[nBlades]; float t[nBlades]; float distance[nBlades]; float angle[nBlades]; float sway[nBlades]; float pmouseX=0; float pmouseY=0; void drawBlade2(float x, float y, int i){ angle[i]=atan2(mouseX-x,mouseY-y); //angle to mouse distance[i]=dist(x,y,mouseX,mouseY); //distance [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cwwang.com/wordpress/wp-content/uploads/wk6grassscreenshot_1.png" title="wk6grassscreenshot_1.png" rel="lightbox[352]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/wk6grassscreenshot_1.thumbnail.png" width="128" height="87" alt="wk6grassscreenshot_1.png" class="imageframe" /></a><br />
A small step towards realistic grass in openGL and C.  Grass responds to &#8220;petting&#8221; via mouse control.</p>
<p><span id="more-352"></span></p>
<pre><code>//grass
# define nBlades 30000

int randomX[nBlades];
int randomY[nBlades];
int randomHeight[nBlades];
float randomWindVelocity[nBlades];
float t[nBlades];
float distance[nBlades];
float angle[nBlades];
float sway[nBlades];
float	pmouseX=0;
float	pmouseY=0;
void drawBlade2(float x, float y, int i){
	angle[i]=atan2(mouseX-x,mouseY-y); //angle to mouse
	distance[i]=dist(x,y,mouseX,mouseY); //distance to mouse
	float tilt=sin(radians(t[i]))*randomHeight[i]/5;//sway distance
		Vec2d mouse=Vec2d(mouseX,mouseY);
		Vec2d A=Vec2d(x,y);//grass root
			Vec2d B=Vec2d(x*3,y*3+randomHeight[i]*.1);//first control point
				Vec2d C=Vec2d(x*3,y*3+randomHeight[i]*.7);
				Vec2d D=Vec2d(x+tilt,y+randomHeight[i]);//grass tip

					float brushSize=dist(pmouseX,pmouseY,mouseX,mouseY);

					if( distance[i]&lt;brushSize){
						sway[i]=randomWindVelocity[i]/distance[i]*9*(constrain(angle[i],-2,2));//random velocity * direction in relation to mouse
					}
					t[i]=t[i]+sway[i]; //sway speed

					//decay
					if (t[i]&gt;.01|| t[i]&lt;-.01){
						t[i]=t[i]*.982;
					}

					glColor3f(.2,(randomHeight[i]/30.0),.15);

					glBegin(GL_LINE_STRIP);
					for (float p=0;p&lt;=1.0;p=p+.5){
						float b=1.0-p;

						Vec2d F=A*b*b*b+B*b*b*p+C*p*p*b+D*p*p*p;

						float gradient=p;
						float nTilt=tilt/80;
						glColor4f(.2*gradient-nTilt,(randomHeight[i]/60.0)*gradient-nTilt,.15*gradient-nTilt,.9);

						glVertex2f(F.x,F.y);

					}
					glEnd();
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://cwwang.com/2007/10/19/grass-brush/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grass 01</title>
		<link>http://cwwang.com/2007/10/11/grass-01/</link>
		<comments>http://cwwang.com/2007/10/11/grass-01/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:53:34 +0000</pubDate>
		<dc:creator>che-wei wang</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Comp Form]]></category>
		<category><![CDATA[ITP]]></category>
		<category><![CDATA[Work in Progress]]></category>

		<guid isPermaLink="false">http://cwwang.com/wordpress/2007/10/11/grass-01/</guid>
		<description><![CDATA[I&#8217;m working on an interactive grass mat with Tim Stutts. Using the subtleties in the grass movements, we can imprint text or figures into realistically rendered grass, projected from above. Here&#8217;s my first step. . . Updated Here: Grass Type //grass # define nBlades 10000 int randomX[nBlades]; int randomY[nBlades]; int randomHeight[nBlades]; float randomWindVelocity[nBlades]; float t[nBlades]; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an interactive grass mat with <a href="http://itp.nyu.edu/~ts1200/blog/">Tim Stutts</a>.  Using the subtleties in the grass movements, we can imprint text or figures into realistically rendered grass, projected from above.  Here&#8217;s my first step. . .</p>
<p>Updated Here: <a href="http://cwwang.com/2007/10/28/grass/">Grass Type</a><br />
<span id="more-331"></span><br />
<a href="http://cwwang.com/wordpress/wp-content/uploads/grass01wk5.png" title="grass01wk5.png" rel="lightbox[331]" rel="lightbox"><img src="http://cwwang.com/wordpress/wp-content/uploads/grass01wk5.thumbnail.png" alt="grass01wk5.png" class="imageframe" height="99" width="128" /></a></p>
<pre><code>//grass
# define nBlades 10000

int randomX[nBlades];
int randomY[nBlades];
int randomHeight[nBlades];
float randomWindVelocity[nBlades];
float t[nBlades];
float distance[nBlades];
float angle[nBlades];
float sway[nBlades];

void drawBlade2(float x, float y, int i){

	angle[i]=atan2(mouseX-x,mouseY-y); //angle to mouse
	distance[i]=dist(x,mouseX,y,mouseY); //distance to mouse
	float tilt=sin(radians(t[i]))*randomHeight[i]/5;//sway distance

		Vec2d A=Vec2d(x,y);//grass root
			Vec2d B=Vec2d(x*3,y*3+randomHeight[i]*.1);//first control point at 1/4 of height
				Vec2d C=Vec2d(x*3,y*3+randomHeight[i]*.9);
				Vec2d D=Vec2d(x+tilt,y+randomHeight[i]);//grass tip

					if( distance[i]&amp;lt;100){
						sway[i]=randomWindVelocity[i]/50*constrain(angle[i],-1,1);//random velocity * direction in relationt to mouse
					}
					t[i]=t[i]+sway[i]; //sway speed

					//decay
					if (t[i]&amp;gt;.01|| t[i]&amp;lt;-.01){
						t[i]=t[i]*.997;
					}

					glColor3f(.2,(randomHeight[i]/80.0),.15);

					glBegin(GL_LINE_STRIP);
					for (float p=0;p&amp;lt;1.0;p=p+.4){
						float b=1.0-p;

						Vec2d y=A*b*b*b+B*b*b*p+C*p*p*b+D*p*p*p;

						float gradient=p;
						glColor4f(.2*gradient,(randomHeight[i]/60.0)*gradient,.15*gradient,.9);
						glVertex2f(y.x,y.y);
					}
					glEnd();
}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://cwwang.com/2007/10/11/grass-01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

