<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>0.714285714 (c[a,o]s[a,o][s] de justin)</title>
<link>http://www.1014.org/</link>
<description>0.714285714 (c[a,o]s[a,o][s] de justin)</description>
<item>
<title>ah, 1997. or: nostalgia</title>
<link>http://www.1014.org/?fromrss=y&amp;article=360</link>
<pubDate>Sat, 25 Oct 2008 10:14:00 -0700</pubDate>
<description>So in 1996 and 1997 I wrote a 3D library called &lt;a href=&quot;http://1014.org/code/nullsoft/plush/&quot;&gt;Plush&lt;/a&gt;. Here is a screenshot from then:
&lt;p&gt;&lt;img src=&quot;http://1014.org/code/nullsoft/plush/images/screenshot4.gif&quot;&gt;&lt;p&gt;
&lt;p&gt;It was written in C, it tried to be very portable (reading through it now, I'd say almost to a fault -- kinda annoying ;). There were some nifty things about it:&lt;ul&gt;
&lt;li&gt;256 color output with adaptive palette creation and management
&lt;li&gt;multiple light sources
&lt;li&gt;piecewise linear perspective corrected texture mapping
&lt;li&gt;Gouraud shading with color ramps that let you do fakePhong
&lt;li&gt;optional Z-buffering
&lt;li&gt;environment mapping
&lt;li&gt;object hierarchies
&lt;li&gt;frustum clipping
&lt;li&gt;cameras 
&lt;li&gt;splines
&lt;li&gt;matrix functions
&lt;li&gt;primitive generation
&lt;li&gt;very basic translucency
&lt;/ul&gt;
Totally useless today. But it would run SO fast with 20x the power available...
&lt;p&gt;The code itself wasn't too bad, some stuff that I had spent ages tweaking and getting to run smoothly would surely be reusable.
&lt;p&gt;So in about 8 hours of work I transformed it into Plush2, which is similar to the above, except simplified in C++, renders to 32 bit per pixel output, integrates with our &lt;A href=&quot;http://www.cockos.com/wdl&quot;&gt;LICE&lt;/a&gt; compositing engine, and supports the following new features:&lt;ul&gt;
&lt;li&gt;24 bit color output
&lt;li&gt;multiple COLORED light sources
&lt;li&gt;Texture mapping (piecewise linear perspective corrected) with optional BILINEAR filtering and support for any sized texture, support for texture transparency.
&lt;li&gt;Colored Gouraud shading
&lt;li&gt;Z-buffering
&lt;li&gt;True surface transparency support
&lt;li&gt;Multitexture support (one or both textures can be used as environment maps)
&lt;li&gt;Full control over how pixels are combined at render -- add, mulitply are supported replace, all with alpha control.
&lt;li&gt;No limits on number of light sources, triangles, etc.
&lt;/ul&gt;
A screenshot:
&lt;p&gt;&lt;img src=&quot;http://shup.com/Shup/74831/108925225722-LICE-Test-App.png&quot;&gt;&lt;p&gt;
&lt;p&gt;Yes yes I know 3D stuff has all been done a ton, just thought it was interesting bringing things back from the dead to see what would be reusable. Now I'm going to go hug my 2.4ghz multicore processor.
&lt;p&gt;This will be a part of the next &lt;a href=&quot;http://www.cockos.com/wdl&quot;&gt;WDL&lt;/a&gt; release, in case anybody cares, ha ha. It does compile down to pretty small (though not small enough to go making a 4k demo with it)
&lt;p&gt;&lt;p&gt;&lt;p&gt;</description>
</item>
<item>
<title>stumbling in code</title>
<link>http://www.1014.org/?fromrss=y&amp;article=359</link>
<pubDate>Wed, 01 Oct 2008 10:14:00 -0700</pubDate>
<description>So while playing with some code to model a resonating spring (F=-k*pos), I discovered that 
the model I was using produced a very good sine wave approximation. This isn't
normally something terribly interesting, as you can approximate sine/cosines
very easily, but it was actually quite low complexity -- an iterative 
approximation with only 2 multiplies and 3 adds per sample.  It can also 
generate the cos() (well, a 90 degree shifted signal) for each point for just one additional multiply.
&lt;p&gt;The error is pretty low for the first few cycles, though after a bit it does 
drift in relation to the correct wave. I'm not going to spend too much more 
time on this, but if anybody wants to see if there's some way to correct it, 
go for it (it may just be rounding error, though, of course). 
&lt;p&gt;Here is the code:&lt;BR&gt;&lt;ul&gt;
  // setup:&lt;BR&gt;
  double cos_sc = PI/period_samples;  // PI/n for a period of n&lt;BR&gt;
  double pos=0;                       // actually sin(initial_state), 1 for cos(), 0 for sin()&lt;BR&gt;
  double vel=1/cos_sc;                // actually cos(initial_state)/cos_sc, 0 for cos(),1/cos_sc for sin()&lt;BR&gt;
  double tmp = cos_sc*cos_sc;&lt;BR&gt;
  double tmp2 = 1.0/(1.0+tmp);&lt;BR&gt;
  double mul1 = (1.0-tmp)*tmp2;&lt;BR&gt;
  double mul2 = tmp*2.0*tmp2;&lt;BR&gt;
&lt;BR&gt;
  // per-sample calculation&lt;BR&gt;
  double output_value=pos;&lt;BR&gt;
  // double cosine_output = vel*cos_sc;&lt;BR&gt;
&lt;p&gt;  // iterate to next sample&lt;BR&gt;
  double newpos = pos*mul1 + vel*mul2;&lt;BR&gt;
  vel -= (pos+newpos);&lt;BR&gt;
  pos = newpos;&lt;BR&gt;
&lt;BR&gt;
&lt;/ul&gt;
Ta-da! If anybody wants to go and do some fancy pants math to show why this works, too, I'd love to hear it... :)
&lt;p&gt;&lt;p&gt;</description>
</item>
<item>
<title>mobile update</title>
<link>http://www.1014.org/?fromrss=y&amp;article=358</link>
<pubDate>Sun, 07 Sep 2008 04:44:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_358.jpg&quot;&gt;&lt;p&gt;
&lt;p&gt;Another tag, yay
</description>
</item>
<item>
<title>Come on, sf dpw</title>
<link>http://www.1014.org/?fromrss=y&amp;article=357</link>
<pubDate>Wed, 03 Sep 2008 23:46:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_357.jpg&quot;&gt;&lt;p&gt;
Time to request a hearing, as I do not have any &quot;graffiti&quot; but they  
seem to think I do....
</description>
</item>
<item>
<title>After 18 hours</title>
<link>http://www.1014.org/?fromrss=y&amp;article=356</link>
<pubDate>Thu, 21 Aug 2008 20:22:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_356.jpg&quot;&gt;&lt;p&gt;
The smiley face was me...
</description>
</item>
<item>
<title>Front door</title>
<link>http://www.1014.org/?fromrss=y&amp;article=355</link>
<pubDate>Thu, 21 Aug 2008 00:46:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_355.jpg&quot;&gt;&lt;p&gt;
We'll see if this works-- both with the kids and with the city...
</description>
</item>
<item>
<title>Interesting sense of humor</title>
<link>http://www.1014.org/?fromrss=y&amp;article=354</link>
<pubDate>Sun, 10 Aug 2008 19:09:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_354.jpg&quot;&gt;&lt;p&gt;
(note the car #)
</description>
</item>
<item>
<title>cures for jet lag:</title>
<link>http://www.1014.org/?fromrss=y&amp;article=353</link>
<pubDate>Sat, 02 Aug 2008 20:15:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_353.jpg&quot;&gt;&lt;p&gt;
The 3 Cs: caffeine, calories, and cocktails... Of course you need the  
right amount of all, and the right sequencing, but if you get that all  
is forgiven.
&lt;p&gt;And days like this don't hurt either...
</description>
</item>
<item>
<title>Spring Cleaning</title>
<link>http://www.1014.org/?fromrss=y&amp;article=352</link>
<pubDate>Tue, 29 Jul 2008 02:55:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_352.jpg&quot;&gt;&lt;p&gt;
Found my laptop with ergonomic keyboard!
</description>
</item>
<item>
<title>I love PHP</title>
<link>http://www.1014.org/?fromrss=y&amp;article=351</link>
<pubDate>Fri, 25 Jul 2008 10:14:00 -0700</pubDate>
<description>Can I just say it? It's such a great tool. I know, I know, it's for web pages, you say.. But I've been using it for tasks people would use perl for, and it's great. Converting Windows .rc files into SWELL-able C++, converting at&amp;t assembly syntax to intel syntax for Jesusonic, such great things. Hooray for PHP. Easy to install on Win32 (just unzip), comes on OS X, it's a good time. A+.
&lt;p&gt;Thank you that is all.
</description>
</item>
<item>
<title>Cubs vs Giants</title>
<link>http://www.1014.org/?fromrss=y&amp;article=350</link>
<pubDate>Fri, 04 Jul 2008 01:43:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_350.jpg&quot;&gt;&lt;p&gt;
Still hot out, for now.. Time to shotgun a contraband Bud Lite in the  
bathroom...
</description>
</item>
<item>
<title>Rad toy</title>
<link>http://www.1014.org/?fromrss=y&amp;article=349</link>
<pubDate>Tue, 24 Jun 2008 06:54:00 -0700</pubDate>
<description>&lt;img src=&quot;http://1014.org/mobilecam/image_349.jpg&quot;&gt;&lt;p&gt;
Woohoo the tiny maudio ekeys 37, $49, arrived... It's small, and light.
</description>
</item>
</channel>
</rss>
