<?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>soledad penadés &#187; Software</title>
	<atom:link href="http://soledadpenades.com/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://soledadpenades.com</link>
	<description>repeat 4[fd 100 rt 90]</description>
	<lastBuildDate>Wed, 25 Apr 2012 21:10:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Simple yet Frequently Asked Questions on three.js (SFAQ)</title>
		<link>http://soledadpenades.com/2012/04/17/simple-yet-frequently-asked-questions-on-three-js-sfaq/</link>
		<comments>http://soledadpenades.com/2012/04/17/simple-yet-frequently-asked-questions-on-three-js-sfaq/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 19:43:37 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[sfaq]]></category>
		<category><![CDATA[three.js]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3957</guid>
		<description><![CDATA[As promised, here&#8217;s what I learnt with my latest test with three.js :-D How do I get smooth color transitions between the vertices of a face? If you want to get color &#8220;interpolation&#8221; like the faces in the image&#8230; &#8230; you have to do a few things: Create a colors array, with as many entries [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://soledadpenades.com/2012/04/16/mesh-subdivision-2012-extended-edition/">promised</a>, here&#8217;s what I learnt with my <a href="http://lab.soledadpenades.com/js/mesh_subdivision">latest test</a> with <a href="https://github.com/mrdoob/three.js">three.js</a> :-D<br />
<span id="more-3957"></span></p>
<h3>How do I get smooth color transitions between the vertices of a face?</h3>
<p>If you want to get color &#8220;interpolation&#8221; like the faces in the image&#8230;<br />
<img src="/imgs/2012/ms02.jpg" alt="mesh subdivision" /></p>
<p>&#8230; you have to do a few things:</p>
<ol>
<li>Create a colors array, with as many entries as vertices in your mesh.</li>
<li>Set the colors array as the <strong>vertexColors</strong> property of the geometry</li>
<li>Using <strong>THREE.MeshBasicMaterial</strong>, set the <strong>vertexColors</strong> property to <strong>THREE.VertexColors</strong></li>
</ol>
<p>This would create a single-triangle mesh, with red, green and blue colors in each vertex respectively:</p>
<div class="syhi_block"><code><span style="color: #003366; font-weight: bold;">var</span> vertices <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> colors <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> faces <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> geometry<span style="color: #339933;">,</span> material<span style="color: #339933;">,</span> mesh<span style="color: #339933;">;</span><br />
<br />
vertices.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vertex</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vector3</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
colors.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Color</span><span style="color: #009900;">&#40;</span>0xFF0000<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
vertices.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vertex</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vector3</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
colors.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Color</span><span style="color: #009900;">&#40;</span>0x00FF00<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
vertices.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vertex</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Vector3</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
colors.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Color</span><span style="color: #009900;">&#40;</span>0x0000FF<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// 0, 1 and 2 are the indices of the vertices in the vertices array</span><br />
faces.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Face3</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
geometry <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Geometry</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
geometry.<span style="color: #660066;">vertices</span> <span style="color: #339933;">=</span> vertices<span style="color: #339933;">;</span><br />
geometry.<span style="color: #660066;">faces</span> <span style="color: #339933;">=</span> faces<span style="color: #339933;">;</span><br />
geometry.<span style="color: #660066;">vertexColors</span> <span style="color: #339933;">=</span> colors<span style="color: #339933;">;</span><br />
<br />
material <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">MeshBasicMaterial</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> vertexColors<span style="color: #339933;">:</span> THREE.<span style="color: #660066;">VertexColors</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
mesh <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">Mesh</span><span style="color: #009900;">&#40;</span>geometry<span style="color: #339933;">,</span> material<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<h3>How do I change the line width of an object displayed as wireframe?</h3>
<p>Using <strong>THREE.MeshBasicMaterial</strong>, set the value of the wireframeLinewidth property:</p>
<p>E.g. for a black, three units thick wireframe material:</p>
<div class="syhi_block"><code><span style="color: #003366; font-weight: bold;">var</span> mat <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">MeshBasicMaterial</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> wireframeLinewidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> color<span style="color: #339933;">:</span> 0x000000<span style="color: #339933;">,</span> wireframe<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<h3>How do I make an object display as double-sided?</h3>
<p>I thought this was a property that had to be set in the material, but I was wrong. It&#8217;s an Object3D property, so if you want an object to display both of its sides, you have to do:</p>
<div class="syhi_block"><code>mesh.<span style="color: #660066;">doubleSided</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></code></div>
<h3>Why aren&#8217;t the children objects hidden when the parent is <em>invisible</em>?</h3>
<p>For optimisation reasons this is not automatic. So you have to manually iterate over the parent&#8217;s children and set their visible property explicitly. But three.js has a utility function for traversing object hierarchies:</p>
<div class="syhi_block"><code><span style="color: #003366; font-weight: bold;">var</span> visible <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
THREE.<span style="color: #660066;">SceneUtils</span>.<span style="color: #660066;">traverseHierarchy</span><span style="color: #009900;">&#40;</span>parent<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>child<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; child.<span style="color: #660066;">visible</span> <span style="color: #339933;">=</span> visible<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<h3>How do I get the camera position updated? It&#8217;s not moving even if I change its position!</h3>
<p>Ah, because you have to tell it where to <em>lookAt</em>. Assuming <em>camera_x</em>, <em>camera_y</em> and <em>camera_z</em> are numbers, and <em>cam_target</em> is a <strong>Vector3</strong>:</p>
<div class="syhi_block"><code>camera.<span style="color: #660066;">position</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> camera_x<span style="color: #339933;">;</span><br />
camera.<span style="color: #660066;">position</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">=</span> camera_y<span style="color: #339933;">;</span><br />
camera.<span style="color: #660066;">position</span>.<span style="color: #660066;">z</span> <span style="color: #339933;">=</span> camera_z<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
camera.<span style="color: #660066;">lookAt</span><span style="color: #009900;">&#40;</span> cam_target <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<p>Every time you change either the camera position or the target position (or both!) you need to call <strong>camera.lookAt</strong> or you won&#8217;t get any visible result.</p>
<p>This seems to be a recent change in three.js. Apparently the camera was automatically updated in older revisions.</p>
<h3>How do I get the contents of the current canvas? All I get is an empty, transparent image in Chrome!</h3>
<p>This is an <a href="http://code.google.com/p/chromium/issues/detail?id=82086">expected</a> behaviour of the WebGL implementation. The solution is to create the WebGL context with the <em>preserveDrawingBuffer</em> flag. Of course, three.js already has that in mind!</p>
<p>So you simply have to add that parameter when initialising the renderer:</p>
<div class="syhi_block"><code>renderer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> THREE.<span style="color: #660066;">WebGLRenderer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> preserveDrawingBuffer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></code></div>
<p>Once that&#8217;s done you can happily extract screenshots of the current output with the usual <strong>canvas.toDataURL</strong> (although I <a href="http://soledadpenades.com/2012/04/16/mesh-subdivision-2012-extended-edition/">used</a> <strong>canvas.toBlob</strong> for directly downloading the image to the browser).</p>
<h3>How do I modify a geometry dynamically? (from javascript, not in a vertex shader)</h3>
<p>This is my super favourite question, so I left it for the end!</p>
<p>You can change the vertices position in a geometry once it&#8217;s been added to the scene, but you won&#8217;t notice any difference until you let three.js know that you&#8217;ve changed something in the object!</p>
<p>That&#8217;s done with:</p>
<div class="syhi_block"><code>mesh.<span style="color: #660066;">geometry</span>.__dirtyVertices <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></code></div>
<p>every time you&#8217;ve modified the geometry and need to get it updated in the screen.</p>
<p><a href="http://mrdoob.com">Mr.doob</a> told me it&#8217;s also possible to modify other geometry properties, such as the vertex colors. If you modify the vertex colors, you then need to set the __dirtyColors property to true.</p>
<p>Actually, this is not the &#8216;proper&#8217; way of doing things with WebGL. Every time a geometry is marked as &#8216;dirty&#8217;, it needs to be re-sent and re-created in the GPU, so to speak. Therefore, this flexibility comes at a cost; the larger the geometry, the slowest it&#8217;ll be. I should be doing these calculations in a vertex shader, running in the GPU, but since I&#8217;m still learning I&#8217;m allowing myself this little computational luxury ;-)</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3957&amp;md5=873c8f2ce88b6b1c66096437672c5720" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2012/04/17/simple-yet-frequently-asked-questions-on-three-js-sfaq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2012%2F04%2F17%2Fsimple-yet-frequently-asked-questions-on-three-js-sfaq%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=Simple+yet+Frequently+Asked+Questions+on+three.js+%28SFAQ%29&amp;amp;description=As+promised%2C+here%27s+what+I+learnt+with+my+latest+test+with+three.js+%3A-D%0D%0A%0D%0AHow+do+I+get+smooth+color+transitions+between+the+vertices+of+a+face%3F%0D%0A%0D%0AIf+you+want+to+get+color+%22interpolation%22+like+the+faces+in+the+image...%0D%0A%0D%0A%0D%0A...+you+have+to+do+a+few+things%3A%0D%0A%0D%0A%0D%0A%09Create+a+colors+array%2C+with+as+many+entries+as+vertices+in+your+mesh.%0D%0A%09Set+the+colors+array+as+the+vertexColors+property+of+the+geometry%0D%0A%0D%0A%09Using+THREE.MeshBasicMaterial%2C+set+the+vertexColors+property+to+THREE.VertexColors%0D%0A%0D%0A%0D%0AThis+would+create+a+single-triangle+mesh%2C+with+red%2C+green+and+blue+colors+in+each+vertex+respectively%3A%0D%0A%0D%0A%0D%0Avar+vertices+%3D+%5B%5D%2C+colors+%3D+%5B%5D%2C+faces+%3D+%5B%5D%2C+geometry%2C+material%2C+mesh%3B%0D%0A%0D%0Avertices.push%28+new+THREE.Vertex%28+new+THREE.Vector3%280%2C+0%2C+0%29+%29+%29%3B%0D%0Acolors.push%28+new+THREE.Color%280xFF0000%29+%29%3B%0D%0A%0D%0Avertices.push%28+new+THREE.Vertex%28+new+THREE.Vector3%280%2C+1%2C+0%29+%29+%29%3B%0D%0Acolors.push%28+new+THREE.Color%280x00FF00%29+%29%3B%0D%0A%0D%0Avertices.push%28+new+THREE.Vertex%28+new+THREE.Vector3%281%2C+1%2C+0%29+%29+%29%3B%0D%0Acolors.push%28+new+THREE.Color%280x0000FF%29+%29%3B%0D%0A%0D%0A%2F%2F+0%2C+1+and+2+are+the+indices+of+the+vertices+in+the+vertices+array%0D%0Afaces.push%28+new+THREE.Face3%280%2C+1%2C+2%29+%29%3B%0D%0A%0D%0Ageometry+%3D+new+THREE.Geometry%28%29%3B%0D%0Ageometry.vertices+%3D+vertices%3B%0D%0Ageometry.faces+%3D+faces%3B%0D%0Ageometry.vertexColors+%3D+colors%3B%0D%0A%0D%0Amaterial+%3D+new+THREE.MeshBasicMaterial%28%7B+vertexColors%3A+THREE.VertexColors+%7D%29%3B%0D%0A%0D%0Amesh+%3D+new+THREE.Mesh%28geometry%2C+material%29%3B%0D%0A%0D%0A%0D%0AHow+do+I+change+the+line+width+of+an+object+displayed+as+wireframe%3F%0D%0A%0D%0AUsing+THREE.MeshBasicMaterial%2C+set+the+value+of+the+wireframeLinewidth+property%3A%0D%0A%0D%0AE.g.+for+a+black%2C+three+units+thick+wireframe+material%3A%0D%0A%0D%0A%0D%0Avar+mat+%3D+new+THREE.MeshBasicMaterial%28%7B+wireframeLinewidth%3A+3%2C+color%3A+0x000000%2C+wireframe%3A+true+%7D%29%3B%0D%0A%0D%0A%0D%0AHow+do+I+make+an+object+display+as+double-sided%3F%0D%0A%0D%0AI+thought+this+was+a+property+that+had+to+be+set+in+the+material%2C+but+I+was+wrong.+It%27s+an+Object3D+property%2C+so+if+you+want+an+object+to+display+both+of+its+sides%2C+you+have+to+do%3A%0D%0A%0D%0A%0D%0Amesh.doubleSided+%3D+true%3B%0D%0A%0D%0A%0D%0AWhy+aren%27t+the+children+objects+hidden+when+the+parent+is+invisible%3F%0D%0A%0D%0AFor+optimisation+reasons+this+is+not+automatic.+So+you+have+to+manually+iterate+over+the+parent%27s+children+and+set+their+visible+property+explicitly.+But+three.js+has+a+utility+function+for+traversing+object+hierarchies%3A%0D%0A%0D%0A%0D%0Avar+visible+%3D+false%3B%0D%0ATHREE.SceneUtils.traverseHierarchy%28parent%2C+function%28child%29+%7B%0D%0A%09child.visible+%3D+visible%3B%0D%0A%7D%29%3B%0D%0A%0D%0A%0D%0AHow+do+I+get+the+camera+position+updated%3F+It%27s+not+moving+even+if+I+change+its+position%21%0D%0A%0D%0AAh%2C+because+you+have+to+tell+it+where+to+lookAt.+Assuming+camera_x%2C+camera_y+and+camera_z+are+numbers%2C+and+cam_target+is+a+Vector3%3A%0D%0A%0D%0A%0D%0Acamera.position.x+%3D+camera_x%3B%0D%0Acamera.position.y+%3D+camera_y%3B%0D%0Acamera.position.z+%3D+camera_z%3B%0D%0A%09%09%0D%0Acamera.lookAt%28+cam_target+%29%3B%0D%0A%0D%0A%0D%0AEvery+time+you+change+either+the+camera+position+or+the+target+position+%28or+both%21%29+you+need+to+call+camera.lookAt+or+you+won%27t+get+any+visible+result.%0D%0A%0D%0AThis+seems+to+be+a+recent+change+in+three.js.+Apparently+the+camera+was+automatically+updated+in+older+revisions.%0D%0A%0D%0AHow+do+I+get+the+contents+of+the+current+canvas%3F+All+I+get+is+an+empty%2C+transparent+image+in+Chrome%21%0D%0A%0D%0AThis+is+an+expected+behaviour+of+the+WebGL+implementation.+The+solution+is+to+create+the+WebGL+context+with+the+preserveDrawingBuffer+flag.+Of+course%2C+three.js+already+has+that+in+mind%21%0D%0A%0D%0ASo+you+simply+have+to+add+that+parameter+when+initialising+the+renderer%3A%0D%0A%0D%0A%0D%0Arenderer+%3D+new+THREE.WebGLRenderer%28%7B+preserveDrawingBuffer%3A+true+%7D%29%3B%0D%0A%0D%0A%0D%0AOnce+that%27s+done+you+can+happily+extract+screenshots+of+the+current+output+with+the+usual+canvas.toDataURL+%28although+I+used+canvas.toBlob+for+directly+downloading+the+image+to+the+browser%29.%0D%0A%0D%0AHow+do+I+modify+a+geometry+dynamically%3F+%28from+javascript%2C+not+in+a+vertex+shader%29%0D%0A%0D%0AThis+is+my+super+favourite+question%2C+so+I+left+it+for+the+end%21%0D%0A%0D%0AYou+can+change+the+vertices+position+in+a+geometry+once+it%27s+been+added+to+the+scene%2C+but+you+won%27t+notice+any+difference+until+you+let+three.js+know+that+you%27ve+changed+something+in+the+object%21%0D%0A%0D%0AThat%27s+done+with%3A%0D%0A%0D%0A%0D%0Amesh.geometry.__dirtyVertices+%3D+true%3B%0D%0A%0D%0A%0D%0Aevery+time+you%27ve+modified+the+geometry+and+need+to+get+it+updated+in+the+screen.%0D%0A%0D%0AMr.doob+told+me+it%27s+also+possible+to+modify+other+geometry+properties%2C+such+as+the+vertex+colors.+If+you+modify+the+vertex+colors%2C+you+then+need+to+set+the+__dirtyColors+property+to+true.%0D%0A%0D%0AActually%2C+this+is+not+the+%27proper%27+way+of+doing+things+with+WebGL.+Every+time+a+geometry+is+marked+as+%27dirty%27%2C+it+needs+to+be+re-sent+and+re-created+in+the+GPU%2C+so+to+speak.+Therefore%2C+this+flexibility+comes+at+a+cost%3B+the+larger+the+geometry%2C+the+slowest+it%27ll+be.+I+should+be+doing+these+calculations+in+a+vertex+shader%2C+running+in+the+GPU%2C+but+since+I%27m+still+learning+I%27m+allowing+myself+this+little+computational+luxury+%3B-%29&amp;amp;tags=sfaq%2Cthree.js%2Cwebgl%2Cblog" type="text/html" />
	</item>
		<item>
		<title>USB Tethering with wicd, an Android phone and ArchLinux</title>
		<link>http://soledadpenades.com/2012/03/25/usb-tethering-with-wicd-an-android-phone-and-archlinux/</link>
		<comments>http://soledadpenades.com/2012/03/25/usb-tethering-with-wicd-an-android-phone-and-archlinux/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 17:18:28 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[arch linux]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[tethering]]></category>
		<category><![CDATA[wicd]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3930</guid>
		<description><![CDATA[It seems wicd doesn&#8217;t automagically use the tethered interface, unlike GNOME&#8217;s network manager. So to get it to work, first we need to find out the name of the tethered interface (i.e. you need to have the phone connected and tethering enabled at this point already). It should be something like usb0. To find this [...]]]></description>
			<content:encoded><![CDATA[<p>It seems wicd doesn&#8217;t automagically use the tethered interface, unlike GNOME&#8217;s network manager.</p>
<p>So to get it to work, first we need to find out the name of the tethered interface (i.e. you need to have the phone connected and tethering enabled at this point already). It should be something like usb0. To find this out you would normally use ifconfig to get a list of the network interfaces&#8230; but Arch Linux has deprecated the <strong>net-tools</strong> package, which contained ifconfig amongst other tools. There&#8217;s a solution though: use
<div class="syhi_block"><code>ip addr</code></div>
<p> which will show you pretty much the same information (you might need to prepend sudo to the command).</p>
<p>Once you know what the interface name is, open WiCD, go to <strong>Preferences</strong>, then the &#8220;General settings&#8221; tab, and finally make sure the entry for &#8220;wired interface&#8221; contains the name of the tethered interface you just found out (i.e. usb0). I have also ticked the &#8220;Always show wired interface&#8221; and &#8220;Always switch to a wired connection when available&#8221;. Finally press OK and hopefully it should automatically connect with tethering.</p>
<p>This evidently isn&#8217;t an optimal solution &#8211;ideally I&#8217;d like WiCD to find these things by itself! But it should be OK as a temporary fix until we set up a proper home network. Meanwhile, hooray for tethering!</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3930&amp;md5=14f8cc851ff6e045aa6693223f7e6b9f" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2012/03/25/usb-tethering-with-wicd-an-android-phone-and-archlinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2012%2F03%2F25%2Fusb-tethering-with-wicd-an-android-phone-and-archlinux%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=USB+Tethering+with+wicd%2C+an+Android+phone+and+ArchLinux&amp;amp;description=It+seems+wicd+doesn%27t+automagically+use+the+tethered+interface%2C+unlike+GNOME%27s+network+manager.%0D%0A%0D%0ASo+to+get+it+to+work%2C+first+we+need+to+find+out+the+name+of+the+tethered+interface+%28i.e.+you+need+to+have+the+phone+connected+and+tethering+enabled+at+this+point+already%29.+It+should+be+something+like+usb0.+To+find+this+out+you+would+normally+use+ifconfig+to+get+a+list+of+the+network+interfaces...+but+Arch+Linux+has+deprecated+the+net-tools+package%2C+which+contained+ifconfig+amongst+other+tools.+There%27s+a+solution+though%3A+use+ip+addr+which+will+show+you+pretty+much+the+same+information+%28you+might+need+to+prepend+sudo+to+the+command%29.%0D%0A%0D%0AOnce+you+know+what+the+interface+name+is%2C+open+WiCD%2C+go+to+Preferences%2C+then+the+%22General+settings%22+tab%2C+and+finally+make+sure+the+entry+for+%22wired+interface%22+contains+the+name+of+the+tethered+interface+you+just+found+out+%28i.e.+usb0%29.+I+have+also+ticked+the+%22Always+show+wired+interface%22+and+%22Always+switch+to+a+wired+connection+when+available%22.+Finally+press+OK+and+hopefully+it+should+automatically+connect+with+tethering.%0D%0A%0D%0AThis+evidently+isn%27t+an+optimal+solution+--ideally+I%27d+like+WiCD+to+find+these+things+by+itself%21+But+it+should+be+OK+as+a+temporary+fix+until+we+set+up+a+proper+home+network.+Meanwhile%2C+hooray+for+tethering%21&amp;amp;tags=android%2Carch+linux%2Cifconfig%2Ctethering%2Cwicd%2Cwireless%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Android SDK with Open JDK 1.7 and IntelliJ IDEA 11</title>
		<link>http://soledadpenades.com/2012/02/19/android-sdk-with-open-jdk-1-7-and-intellij-idea-11/</link>
		<comments>http://soledadpenades.com/2012/02/19/android-sdk-with-open-jdk-1-7-and-intellij-idea-11/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 17:25:07 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdk]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3914</guid>
		<description><![CDATA[I updated my installation of IntelliJ IDEA to the latest version and suddenly I couldn&#8217;t compile any Android project, getting a message telling me the .class files couldn&#8217;t be found. Very puzzling! I tried upgrading the JDK from Openjdk 6 to Open JDK 7, but the Android SDK refused to compile because it wanted a [...]]]></description>
			<content:encoded><![CDATA[<p>I updated my installation of IntelliJ IDEA to the latest version and suddenly I couldn&#8217;t compile any Android project, getting a message telling me the .class files couldn&#8217;t be found. Very puzzling!</p>
<p>I tried upgrading the JDK from Openjdk 6 to Open JDK 7, but the Android SDK refused to compile because it wanted a Java 1.6 level SDK.</p>
<p>Thankfully after much searching I discovered a <a href="http://devnet.jetbrains.net/message/5451913#5451913">post</a> that mentioned that IntelliJ 11.1 would be able to compile using 1.7. Thus I downloaded the <em>Early Access Program</em> <a href="http://confluence.jetbrains.net/display/IDEADEV/IDEA+11.1+EAP">version</a> of IDEA and crossed my fingers. Well, sort of; what I did was configuring the IDE to use Java 1.7 both as the project SDK and as the  Java SDK for the Android build target I was going to use (2.3.3 in this case).</p>
<p>After this, I could compile and run my application without any issues.</p>
<p>(This is all with ArchLinux &#8211;it might or not work in your particular system)</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3914&amp;md5=271080c3b1248dc510aecc9fed2151cf" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2012/02/19/android-sdk-with-open-jdk-1-7-and-intellij-idea-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2012%2F02%2F19%2Fandroid-sdk-with-open-jdk-1-7-and-intellij-idea-11%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=Android+SDK+with+Open+JDK+1.7+and+IntelliJ+IDEA+11&amp;amp;description=I+updated+my+installation+of+IntelliJ+IDEA+to+the+latest+version+and+suddenly+I+couldn%27t+compile+any+Android+project%2C+getting+a+message+telling+me+the+.class+files+couldn%27t+be+found.+Very+puzzling%21%0D%0A%0D%0AI+tried+upgrading+the+JDK+from+Openjdk+6+to+Open+JDK+7%2C+but+the+Android+SDK+refused+to+compile+because+it+wanted+a+Java+1.6+level+SDK.%0D%0A%0D%0AThankfully+after+much+searching+I+discovered+a+post+that+mentioned+that+IntelliJ+11.1+would+be+able+to+compile+using+1.7.+Thus+I+downloaded+the+Early+Access+Program+version+of+IDEA+and+crossed+my+fingers.+Well%2C+sort+of%3B+what+I+did+was+configuring+the+IDE+to+use+Java+1.7+both+as+the+project+SDK+and+as+the++Java+SDK+for+the+Android+build+target+I+was+going+to+use+%282.3.3+in+this+case%29.%0D%0A%0D%0AAfter+this%2C+I+could+compile+and+run+my+application+without+any+issues.%0D%0A%0D%0A%28This+is+all+with+ArchLinux+--it+might+or+not+work+in+your+particular+system%29&amp;amp;tags=android%2Carchlinux%2Cintellij+idea%2Cjava%2Cjdk%2Cblog" type="text/html" />
	</item>
		<item>
		<title>ffmpeg on Mac Os X Lion</title>
		<link>http://soledadpenades.com/2012/01/18/ffmpeg-on-mac-os-x-lion/</link>
		<comments>http://soledadpenades.com/2012/01/18/ffmpeg-on-mac-os-x-lion/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 22:28:03 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[mac os x]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3878</guid>
		<description><![CDATA[Now that I&#8217;m using a Mac (with Mac OS) at work I&#8217;m sorely missing truly essential tools such as ffmpeg. The only binary build I could find (without having to download fink and a ton more packages that I don&#8217;t really need) was a build from 2006. Two thousand and six! Which in ffmpeg terms [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;m using a Mac (with Mac OS) at work I&#8217;m sorely missing truly essential tools such as <a href="http://ffmpeg.mplayerhq.hu/">ffmpeg</a>. The only binary build I could find (without having to download fink and a ton more packages that I don&#8217;t really need) was a build from 2006. <em>Two thousand and six</em>! Which in ffmpeg terms is like <strong>the Pleistocene</strong>.</p>
<p>So given that I have XCode installed anyway, I decided to build ffmpeg myself, just as I had done back in 2007. It should be as doable as back then!<br />
<span id="more-3878"></span><br />
I found a <a href="http://www.martinlos.com/?p=41">post</a> by Martin Los, which was pretty much all I needed to get started. I just changed a few things; for example you don&#8217;t need to <em>-enable-libfaad</em> anymore with recent versions of ffmpeg as I think they have their own (experimental?) faad encoder, and don&#8217;t rely on an external library. I also didn&#8217;t install <a href="http://www.libsdl.org/">SDL</a> as from what I remember it was only used for showing ffplay&#8217;s output (mostly for opening a window, showing the decoded video, etc). In any case, ffmpeg compiled fine without having SDL, so I&#8217;m assuming it just didn&#8217;t compile ffplay which frankly I don&#8217;t use.</p>
<p>After I checked that Martin&#8217;s method worked, I decided to convert his instructions into an script. Usually I would write this script with <a href="http://www.python.org/">Python</a> but I am trying to learn a bit more bash lately, so I made an effort (and several searches) and wrote it in <a href="http://www.gnu.org/software/bash/">bash</a> &#8211;and a couple of other utilities such as <a href="http://www.gnu.org/software/sed/manual/sed.html">sed</a> which were already installed on Mac. I believe the only tool which isn&#8217;t installed by default is <a href="http://subversion.apache.org/">Subversion</a>, but I am not entirely sure about this (and I&#8217;m not going to format the system just to check!).</p>
<p>It was also interesting to use <a href="http://curl.haxx.se/">cURL</a> (which is installed on a bare Mac Os) instead of <a href="http://www.gnu.org/software/wget">wget</a>, which I expected to be installed already (it wasn&#8217;t). Apparently SourceForge (which is where the libraries&#8217; sources are hosted) makes some sort of redirection even if you&#8217;re using a direct link. The -L option allows it to follow through 30x redirections until it finds a 200 code or similar.</p>
<p>And here is <a href="https://github.com/sole/snippets/blob/master/video/get_ffmpeg_on_macosx.sh">the script</a> for your enjoyment and all that:</p>
<div class="syhi_block"><code><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Thanks to Martin Los for his guide: http://www.martinlos.com/?p=41</span><br />
<br />
<span style="color: #007800;">URLS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.3.tar.gz&quot;</span> <span style="color: #ff0000;">&quot;http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz&quot;</span> <span style="color: #ff0000;">&quot;http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${URLS[@]}</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$i</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; curl <span style="color: #660033;">-O</span> <span style="color: #660033;">-L</span> <span style="color: #007800;">$i</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.tar.gz <span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> <span style="color: #007800;">$i</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$i</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #000000; font-weight: bold;">/</span>configure<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">make</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> ..<br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">svn</span> checkout <span style="color: #c20cb9; font-weight: bold;">svn</span>:<span style="color: #000000; font-weight: bold;">//</span>svn.ffmpeg.org<span style="color: #000000; font-weight: bold;">/</span>ffmpeg<span style="color: #000000; font-weight: bold;">/</span>trunk <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span><br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-libmp3lame</span> <span style="color: #660033;">--enable-libfaac</span> <span style="color: #660033;">--enable-gpl</span> <span style="color: #660033;">--enable-nonfree</span> <span style="color: #660033;">--enable-shared</span> <span style="color: #660033;">--disable-mmx</span> <span style="color: #660033;">--arch</span>=x86_64 <span style="color: #660033;">--cpu</span>=core2<br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></code></div>
<p>Using this shiny fresh build of ffmpeg I was able to convert several .MOV files which were rendered for iOS devices into MP4 files that Android devices could palate. This is <a href="https://github.com/sole/snippets/blob/master/video/ios_mov_to_android_mp4.sh">the script</a> I wrote (also with bash, to practise <em>even</em> more):</p>
<div class="syhi_block"><code><span style="color: #007800;">WIDTH</span>=<span style="color: #ff0000;">&quot;720&quot;</span><br />
<span style="color: #007800;">HEIGHT</span>=<span style="color: #ff0000;">&quot;480&quot;</span><br />
<span style="color: #007800;">BITRATE</span>=<span style="color: #ff0000;">&quot;1500k&quot;</span><br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.mov<span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-r</span> <span style="color: #000000;">30</span> <span style="color: #660033;">-vcodec</span> mpeg4 <span style="color: #660033;">-acodec</span> libfaac <span style="color: #660033;">-ac</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-ar</span> <span style="color: #000000;">44100</span> <span style="color: #660033;">-vf</span> <span style="color: #007800;">scale</span>=<span style="color: #007800;">$WIDTH</span>:<span style="color: #007800;">$HEIGHT</span> <span style="color: #660033;">-b</span> <span style="color: #007800;">$BITRATE</span> &nbsp;<span style="color: #660033;">-y</span> <span style="color: #007800;">$i</span>.mp4<br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.mov.mp4; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #007800;">j</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.mov.mp4/.mp4/'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$j</span>&quot;</span>; <span style="color: #000000; font-weight: bold;">done</span></code></div>
<p>Hope it&#8217;s useful!</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3878&amp;md5=f98dfe69ba0ee49fa02e589f6d30b4b1" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2012/01/18/ffmpeg-on-mac-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2012%2F01%2F18%2Fffmpeg-on-mac-os-x-lion%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=ffmpeg+on+Mac+Os+X+Lion&amp;amp;description=Now+that+I%27m+using+a+Mac+%28with+Mac+OS%29+at+work+I%27m+sorely+missing+truly+essential+tools+such+as+ffmpeg.+The+only+binary+build+I+could+find+%28without+having+to+download+fink+and+a+ton+more+packages+that+I+don%27t+really+need%29+was+a+build+from+2006.+Two+thousand+and+six%21+Which+in+ffmpeg+terms+is+like+the+Pleistocene.%0D%0A%0D%0ASo+given+that+I+have+XCode+installed+anyway%2C+I+decided+to+build+ffmpeg+myself%2C+just+as+I+had+done+back+in+2007.+It+should+be+as+doable+as+back+then%21%0D%0A%0D%0AI+found+a+post+by+Martin+Los%2C+which+was+pretty+much+all+I+needed+to+get+started.+I+just+changed+a+few+things%3B+for+example+you+don%27t+need+to+-enable-libfaad+anymore+with+recent+versions+of+ffmpeg+as+I+think+they+have+their+own+%28experimental%3F%29+faad+encoder%2C+and+don%27t+rely+on+an+external+library.+I+also+didn%27t+install+SDL+as+from+what+I+remember+it+was+only+used+for+showing+ffplay%27s+output+%28mostly+for+opening+a+window%2C+showing+the+decoded+video%2C+etc%29.+In+any+case%2C+ffmpeg+compiled+fine+without+having+SDL%2C+so+I%27m+assuming+it+just+didn%27t+compile+ffplay+which+frankly+I+don%27t+use.%0D%0A%0D%0AAfter+I+checked+that+Martin%27s+method+worked%2C+I+decided+to+convert+his+instructions+into+an+script.+Usually+I+would+write+this+script+with+Python+but+I+am+trying+to+learn+a+bit+more+bash+lately%2C+so+I+made+an+effort+%28and+several+searches%29+and+wrote+it+in+bash+--and+a+couple+of+other+utilities+such+as+sed+which+were+already+installed+on+Mac.+I+believe+the+only+tool+which+isn%27t+installed+by+default+is+Subversion%2C+but+I+am+not+entirely+sure+about+this+%28and+I%27m+not+going+to+format+the+system+just+to+check%21%29.%0D%0A%0D%0AIt+was+also+interesting+to+use+cURL+%28which+is+installed+on+a+bare+Mac+Os%29+instead+of+wget%2C+which+I+expected+to+be+installed+already+%28it+wasn%27t%29.+Apparently+SourceForge+%28which+is+where+the+libraries%27+sources+are+hosted%29+makes+some+sort+of+redirection+even+if+you%27re+using+a+direct+link.+The+-L+option+allows+it+to+follow+through+30x+redirections+until+it+finds+a+200+code+or+similar.%0D%0A%0D%0AAnd+here+is+the+script+for+your+enjoyment+and+all+that%3A%0D%0A%0D%0A%0D%0A%23%21%2Fbin%2Fbash%0D%0A%0D%0A%23+Thanks+to+Martin+Los+for+his+guide%3A+http%3A%2F%2Fwww.martinlos.com%2F%3Fp%3D41%0D%0A%0D%0AURLS%3D%28%22http%3A%2F%2Fdownloads.sourceforge.net%2Fproject%2Flame%2Flame%2F3.99%2Flame-3.99.3.tar.gz%22+%22http%3A%2F%2Fdownloads.sourceforge.net%2Fproject%2Ffaac%2Ffaac-src%2Ffaac-1.28%2Ffaac-1.28.tar.gz%22+%22http%3A%2F%2Fdownloads.sourceforge.net%2Fproject%2Ffaac%2Ffaad2-src%2Ffaad2-2.7%2Ffaad2-2.7.tar.gz%22%29%0D%0A%0D%0Afor+i+in+%22%24%7BURLS%5B%40%5D%7D%22%0D%0Ado%0D%0A%09echo+%24i%0D%0A%09curl+-O+-L+%24i%0D%0Adone%0D%0A%0D%0Afor+i+in+%24%28+ls+%2A.tar.gz+%29%3B+do%0D%0A%09tar+-xzvf+%24i%0D%0Adone%0D%0A%0D%0Afor+i+in+%24%28+ls+-d+%2A%2F%29%3B+do%0D%0A%09cd+%24i%0D%0A%09.%2Fconfigure%0D%0A%09make%0D%0A%09sudo+make+install%0D%0A%09cd+..%0D%0Adone%0D%0A%0D%0Asvn+checkout+svn%3A%2F%2Fsvn.ffmpeg.org%2Fffmpeg%2Ftrunk+ffmpeg%0D%0Acd+ffmpeg%0D%0A.%2Fconfigure+--enable-libmp3lame+--enable-libfaac+--enable-gpl+--enable-nonfree+--enable-shared+--disable-mmx+--arch%3Dx86_64+--cpu%3Dcore2%0D%0Amake%0D%0Asudo+make+install%0D%0A%0D%0A%0D%0AUsing+this+shiny+fresh+build+of+ffmpeg+I+was+able+to+convert+several+.MOV+files+which+were+rendered+for+iOS+devices+into+MP4+files+that+Android+devices+could+palate.+This+is+the+script+I+wrote+%28also+with+bash%2C+to+practise+even+more%29%3A%0D%0A%0D%0A%0D%0AWIDTH%3D%22720%22%0D%0AHEIGHT%3D%22480%22%0D%0ABITRATE%3D%221500k%22%0D%0Afor+i+in+%24%28ls+%2A.mov%29%3B+do%0D%0A%09ffmpeg+-i+%24i+-r+30+-vcodec+mpeg4+-acodec+libfaac+-ac+1+-ar+44100+-vf+scale%3D%24WIDTH%3A%24HEIGHT+-b+%24BITRATE++-y+%24i.mp4%0D%0Adone%0D%0Afor+i+in+%2A.mov.mp4%3B+do+j%3D%60echo+%24i+%7C+sed+%27s%2F.mov.mp4%2F.mp4%2F%27%60%3B+mv+%22%24i%22+%22%24j%22%3B+done%0D%0A%0D%0A%0D%0AHope+it%27s+useful%21&amp;amp;tags=ffmpeg%2Clion%2Cmac+os+x%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Make Chromium/Chrome blend seamlessly with Gnome 3</title>
		<link>http://soledadpenades.com/2012/01/12/make-chromiumchrome-blend-seamlessly-with-gnome-3/</link>
		<comments>http://soledadpenades.com/2012/01/12/make-chromiumchrome-blend-seamlessly-with-gnome-3/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 21:26:27 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[gnome3]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3864</guid>
		<description><![CDATA[&#8220;Thanks to the power of CSS&#8221; you just need to install these extensions: Adwaita (GNOME 3) Adwaita (GNOME 3) scrollbars (this is optional. Makes the scrollbars look more Gnome-ish) With compliments to mr.doob for revealing me the secret!]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;Thanks to the power of CSS&#8221;</em> you just need to install these extensions:</p>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/oojbknijfmdmidgcgchmojbildmbdamm">Adwaita (GNOME 3)</a></li>
<li><a href="https://chrome.google.com/webstore/detail/bkgmaggeefkcgmhmgiadbhgdoeiajccd/details?hl=en">Adwaita (GNOME 3) scrollbars</a> (this is optional. Makes the scrollbars look more Gnome-ish)</li>
</ul>
<p><em>With compliments to <a href="http://mrdoob.com">mr.doob</a> for revealing me the secret!</em></p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3864&amp;md5=9e6e372c3c90a32bb704a432a9246e7f" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2012/01/12/make-chromiumchrome-blend-seamlessly-with-gnome-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2012%2F01%2F12%2Fmake-chromiumchrome-blend-seamlessly-with-gnome-3%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=Make+Chromium%2FChrome+blend+seamlessly+with+Gnome+3&amp;amp;description=%22Thanks+to+the+power+of+CSS%22+you+just+need+to+install+these+extensions%3A%0D%0A%0D%0A%0D%0A%09Adwaita+%28GNOME+3%29%0D%0A%09Adwaita+%28GNOME+3%29+scrollbars+%28this+is+optional.+Makes+the+scrollbars+look+more+Gnome-ish%29%0D%0A%0D%0A%0D%0AWith+compliments+to+mr.doob+for+revealing+me+the+secret%21&amp;amp;tags=chrome%2Cchromium%2Cgnome3%2Cthemes%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

