slanning's Journal slanning's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:22:15+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 slanning's Journal pearls cheaper than Perl? According to <a href=""></a>, the material that makes up pearls can now be made as cheaply as paper. So, the cost of producing Perl is more than producing pearl. (Okay, it probably was even before, but I had to make a pun. I'm sorry...) slanning 2010-03-25T22:09:08+00:00 journal OGRE <p>I've recently worked a bit more on <a href="">Perl bindings</a> for <a href="">OGRE</a>. You might remember that I was <a href="">working on this a couple years ago</a>. I updated the bindings to minimally work with the Shoggoth (1.6) API (at least on Ubuntu). It still needs <a href="">a lot of work</a>. </p><p>My motivation is to make a sort of game framework. I think there are similar motivations for the recent revival of the <a href="">SDL bindings</a>. I recently added an example showing how to render Ogre into an SDL OpenGL context, at least on Linux (can be done in Windows too, but I didn't look at it yet). That allows you to write a normal SDL app, with keyboard/mouse input, sounds, and whatever else SDL does, but use Ogre to render 3-D graphics.</p><p>A couple years ago, I went to a talk by Guillaume Cottenceau on "the making of" <a href="">Frozen Bubble</a> at a <a href=""></a> meeting. After that, I read <a href="">a tutorial on "Developing games with Perl and SDL"</a>. I took several detours, but eventually got interested in Ogre instead of using SDL. The problem (or nice thing depending on how you look at it) is that Ogre is focussed on 3-D graphics and leaves you to do all the rest yourself. So I also made <a href="">bindings for OIS</a>, to get keyboard/mouse(/joystick/wiimote/etc.) input; a <a href="">port of a simple GUI library</a>, to let you make simple menus and GUI widgets; and a binding for <a href="">OgreAL</a>, which facilitates integrating OpenAL (sound/music) into 3-D scenes (so you have sound seeming to come from points in space).</p><p>In the back of my mind, I still would like to work on wrapping another GUI library, such as <a href="">MyGUI</a> or in my crazier moments <a href="">CEGUI</a>. I would like to automate more of the API-binding to make it easier to update for each release (have <a href="">ExtUtils::XSpp</a> in mind, for one thing, and also want to improve the use of <a href="">GCC-XML</a>) and to make the bindings more complete. I'd also like to get things compiling on Windows, especially after seeing how easily <a href="">wxPerl</a> compiled on <a href="">Strawberry Perl</a> this weekend.</p> slanning 2009-10-05T07:09:39+00:00 journal concision <p>This would be my comment at <a href="">chromatic</a>'s <a href="">book-promotion blog</a> -- in particular in reply to <a href="">Ovid</a>'s comment -- if I weren't required to sign in there.</p><p>Perl6 will be out soon, right? Why put <a href="">MooseX::Declare</a> in the Perl5 core?</p><p>Anyway, the module failed to install for me. I'll try to work out why, though at first glance... MooseX::Method::Signatures failed to install, and it required</p><blockquote><div><p> <tt>&nbsp; &nbsp; Context::Preserve [requires]<br>&nbsp; &nbsp; Parse::Method::Signatures [requires]<br>&nbsp; &nbsp; MooseX::Meta::TypeConstraint::ForceCoercion [requires]<br>&nbsp; &nbsp; MooseX::Types::Structured [requires]<br>&nbsp; &nbsp; aliased [requires]<br>&nbsp; &nbsp; B::Hooks::EndOfScope [requires]<br>&nbsp; &nbsp; MooseX::Types [requires]<br>&nbsp; &nbsp; Devel::Declare [requires]</tt></p></div> </blockquote><p>and of course Parse::Method::Signatures requires</p><blockquote><div><p> <tt>&nbsp; &nbsp; PPI [requires]<br>&nbsp; &nbsp; MooseX::Types::Structured [requires]<br>&nbsp; &nbsp; aliased [requires]<br>&nbsp; &nbsp; MooseX::Traits [requires]<br>&nbsp; &nbsp; namespace::clean [requires]<br>&nbsp; &nbsp; MooseX::Types [requires]</tt></p></div> </blockquote><p>and naturally PPI needs</p><blockquote><div><p> <tt>&nbsp; &nbsp; Test::Object [requires]<br>&nbsp; &nbsp; Test::ClassAPI [requires]<br>&nbsp; &nbsp; Test::SubCalls [requires]</tt></p></div> </blockquote><p>and Test::SubCalls wants to have</p><blockquote><div><p> <tt>&nbsp; &nbsp; Hook::LexWrap [requires]</tt></p></div> </blockquote><p>Maybe I'll see where the error is sometime soon. Oh, here we go again, MooseX::Types::Structured needs</p><blockquote><div><p> <tt>&nbsp; &nbsp; Sub::Exporter [requires]<br>&nbsp; &nbsp; Devel::PartialDump [requires]</tt></p></div> </blockquote><p>which I'm quite happy to install, yes, now namespace::clean would like</p><blockquote><div><p> <tt>&nbsp; &nbsp; B::Hooks::EndOfScope [requires]</tt></p></div> </blockquote><p>and why shouldn't it since MooseX::Method::Signatures itself did, but it'll need</p><blockquote><div><p> <tt>&nbsp; &nbsp; Variable::Magic [requires]</tt></p></div> </blockquote><p>which I thought I had installed already, but that must've been another machine. So now we're installing MooseX::Meta::TypeConstraint::ForceCoercion which couldn't live without</p><blockquote><div><p> <tt>&nbsp; &nbsp; namespace::autoclean [requires]</tt></p></div> </blockquote><p>which needs a newer version of</p><blockquote><div><p> <tt>&nbsp; &nbsp; Class::MOP [requires]</tt></p></div> </blockquote><p>which warns me that</p><blockquote><div><p> <tt>***<br>&nbsp; &nbsp; This version of Class::MOP conflicts with the version of<br>&nbsp; &nbsp; Moose (0.69) you have installed.<br> <br>&nbsp; &nbsp; You will need to upgrade Moose after installing<br>&nbsp; &nbsp; this version of Class::MOP.<br>***</tt></p></div> </blockquote><p>Yes, yes, fine fine. But, oh no, finally a test failure in the version 0.01 module MooseX::Meta::TypeConstraint::ForceCoercion. I'll try to get back to you after I analyze the Moose / Class::MOP stacktrace explosion, but in the meantime, yeah sure, put that in the core. Thanks. ^.^</p> slanning 2009-05-03T09:01:30+00:00 journal moving to Amsterdam <p>I've had this for a while in my Bio:</p><blockquote><div><p> <cite> Scott Lanning has been nominally hacking <a href="">Bricolage</a> at the <a href="">WHO</a> in Geneva, Switzerland since 2003. </cite></p></div> </blockquote><p>No more! After more than six years, as of yesterday I'm no longer at the WHO, although I might still nominally hack on Bricolage. I'm moving to Amsterdam to work at <a href=""></a>.</p> slanning 2009-04-25T16:06:52+00:00 journal Bricolage 1.10.7 released Bricolage 1.10.7 has been uploaded to the world-wide web. The distribution tarball can be downloaded from <a href=";package_id=177005">;package_id=177005</a> or <a href=""></a> . slanning 2009-03-12T17:59:55+00:00 journal PerlIO spreadsheet2csv <tt>I haven't got it ready for CPAN yet, but I've recently been working on PerlIO::via::Spreadsheet (I don't like the name, but what else could I call it?). It should let you do this:<br><br>open my $fh, '&lt;:via(Spreadsheet)', 'file.xls' or die "Couldn't open file.xls: $!";<br>while (&lt;$fh&gt;) {<br>&nbsp; &nbsp; # spreadsheet emulated as an input stream is translated to CSV<br>&nbsp; &nbsp; # $_ is a line of CSV;&nbsp; &nbsp;(note: for a few minutes this was wrong, updated)<br>&nbsp; &nbsp;<nobr> <wbr></nobr>...<br>}<br><br>The spreadsheet would be whatever Spreadsheet::Read can deal with. Probably more a "neat to hack on" thing than something actually useful. (There are xls2csv utilities already. There are also problems with more complicated spreadsheets that aren't easily handled by a simple IO layer.)<br><br>Another idea I'm playing with is a layer to handle JSON.</tt> slanning 2009-01-27T12:48:30+00:00 journal ok, Perl6:: docs might as well be on CPAN (updated) <p> <b>UPDATE:</b> You're right, I was taking it/things too seriously. <code>$self-&gt;panic--</code> </p><p>----cut-here---8&lt;---------------------------------------------------</p><p>(<i>Note: The following is just my humble opinion, and I don't mean to single out the authors of Perl6::Cookbook or Perl6::Doc. The Subject isn't worded too provocatively, is it?<nobr> <wbr></nobr>:&gt; </i>)</p><p>I don't think it's appropriate for modules like <a href="">Perl6::Cookbook</a> to go on <a href="">CPAN</a>. First, I don't think it's a good idea mixing Perl5 and Perl6 code on CPAN unless/until there are clear ways to distinguish them. By that, I don't mean that the module begins with Perl6, for example, but that the tools like the `cpan` shell are able to ignore Perl6 code (or compatibility issues are otherwise resolved). On the other hand, Perl6::Cookbook doesn't actually install code.</p><p>And that is my main problem; it is not a useable module. Its content is all under eg/, so it doesn't even install <a href="">POD</a> files. Now, several distributions have their own cookbooks (<a href="">Moose</a>, <a href="">Jifty</a>,<nobr> <wbr></nobr>...), but that's different because they are actually documentation of the module, and we certainly don't want to discourage that. Some distributions even separate the docs from the code, like <a href="">YAML::Manual</a>, but again I don't think that's such a big deal (although that one in particular isn't nearly complete<nobr> <wbr></nobr>:) because it's associated to some module; it could be especially useful when those are optional dependencies of the code distribution.</p><p>So I think Perl6::Cookbook is problematic, at least as it's currently implemented, but there is another similar "module" that I'm not so sure about: <a href="">Perl6::Doc</a>. It contains the <a href="">apocalypses</a>, <a href="">synopses</a>, <a href="">exigeses</a> for Perl 6. I'm not sure that should be on CPAN, but on the other hand at least it installs POD files. Also, it's sort of like an informal <a href="">RFC</a>. But on the other hand, what use are they being on CPAN since they are already on the pages I linked to?</p><p>(<i>Note: I considered uploading this blog entry to CPAN, but decided not to.</i>)</p> slanning 2009-01-22T11:10:43+00:00 journal $1.5 trillion stolen Am I misunderstanding something, or have the US banks stolen $1.5 trillion in US tax money in the past month or two? It's <a href="">not the first time this has happened</a>, either. They kept on deregulating away, and now we get to hear how the bailouts will save the economy. slanning 2008-11-27T14:31:06+00:00 journal Bricolage 1.10.6 released <p> <a href="">Bricolage 1.10.6</a> was released. Might be the last one in the 1.10 series. <a href="">David</a> will probably release version 1.11.1 soon, which is a "developer release" for 2.0. He's been hacking on the ajaxy stuff recently.</p> slanning 2008-10-02T14:09:17+00:00 journal school text books There's a <a href="">boycott</a> in Chicago by school children from urban schools. In the first paragraph it's mentioned that "they often have to share books<nobr> <wbr></nobr>... meaning they can't take books home to study". At the bottom they talk about spending <b>$120 million</b> over three years to build more schools. Just for Chicago. We have the web now, even in the USA. Why can't money like that be invested in more fundamental improvements that would benefit everybody, like building free, public-domain, online textbooks? At least at the state level. It's like schools are letting textbook publishers steal money from children. slanning 2008-09-05T09:27:18+00:00 journal butterflies dangerous? <p>You hear often about butterflies, but when's the last time you heard about breadflies? Are these apparently harmless insects in fact ruthless genocidal maniacs who have wiped out the breadfly population?</p><p>I may have to retract <a href="">my opinion about butterflies</a>.</p> slanning 2008-06-18T09:47:19+00:00 journal Bricolage 1.10.5 released After two weeks of furious hacking from <a href="">David</a>, <a href="">Bricolage</a> 1.10.5 has been <a href=";package_id=177005&amp;release_id=595752">uploaded to sourceforge</a>. slanning 2008-04-29T10:22:39+00:00 journal wiimote hacking <a href="">Cool demo</a> (5 mins) hacking a <a href="">wiimote</a>, if you like <a href="">wiimote</a> <a href="">hacks</a>. Note that there is a <a href="">Perlwiimote module on Linux</a> (I haven't used it or a Wii, so couldn't tell you how well it works). slanning 2008-04-15T13:58:27+00:00 journal Continuity and templating <p>I like the idea of <a href="">Continuity</a>. I don't, however, want to go back to using <a href=""></a> (or printing strings directly) to generate HTML. That's probably what Brock has in mind with <a href="">Continuity::Widget</a>. However, sorry, I also don't want to use a widget system hacked up just for Continuity, and that module seems to only be a placeholder right now anyway.</p><p>What I'd really like to do is somehow integrate Continuity with my favorite templating system, <a href="">HTML::Mason</a>. Are these two too different conceptually, though? Mason is based on requests, while Continuity is trying to get rid of them? Not sure yet how Continuity's Mapper and Adapter objects fit with Mason's Request, Resolver, ApacheHandler, Interpret... Anyone have ideas?</p> slanning 2008-03-31T13:12:43+00:00 journal 4-day weekend <p>One happy side-effect of this obsession with <a href="">an old German goddess</a> that people have is a 4-day weekend for me. Yay \o/</p><p>So whatever shall I do....? I was thinking of </p><ul> <li>playing with <a href="">Continuity</a> (like <a href="">Seaside</a> for Perl but not a framework)</li><li>finishing the <a href="">F.E.A.R.</a> series, 3rd game in the pack I bought at home in the USA</li><li>studying <a href="">German</a> [1]</li><li>reading: <ul> <li> <a href="">Evolution</a>, a novel spanning 565 million years of human evolution</li><li> <a href="">L'Aventure des langues en Occident</a>, on the <a href="">Indo-European languages</a> </li><li> <a href="">From Geometry to Topology</a>, really well written (note: has a chapter on continuity (see above<nobr> <wbr></nobr>:) )</li></ul></li><li>working out (end of 4th week, still at it)</li></ul><p>[1] Also: <code>perl -e'for$i(1..4){for$j("01".."26"){`wget$i$j.mp3`}}'</code> </p> slanning 2008-03-20T15:54:49+00:00 journal idealists versus pragmatists <p>From <a href="">Joel Spolsky</a>:</p><p> <cite>As usual, the idealists are 100% right in principle and, as usual, the pragmatists are right in practice.</cite> </p><p>I wouldn't say 100%...<nobr> <wbr></nobr>:) but it's an interesting article, especially in light of some of the discussion about the <a href="">Module::Install deprecations</a>.</p> slanning 2008-03-19T11:15:34+00:00 journal I like butterflies Yes, I do. Hello, data miners of 2022. slanning 2008-03-17T09:02:33+00:00 journal ENOIRC <p>If you're on "" and find there are not very many people on the server, there's apparently a server down somewhere since this morning and you're probably on the wrong side of a <a href="">netsplit</a> . I found that by setting my server explicitly to I could make contact with most of the people normally on the servers.</p><p>Hmm, as I say that I notice a desplitting at least from one of the other servers, so this might not be necessary now.</p> slanning 2008-02-25T14:12:51+00:00 journal headless gecko Looks like someone is realizing <a href="">one of my dreams</a> with <a href="">Crowbar</a>:<p><div class="quote"><p> Crowbar is a web scraping environment based on the use of a server-side headless mozilla-based browser.</p></div> slanning 2008-02-20T15:27:09+00:00 journal Geneva sweet Geneva It's the final countdown. Flying back to Europe tomorrow. Not really anxious to get back to work. Haven't done anything for a month, though; need to take off another....year or two. slanning 2008-02-09T14:39:38+00:00 journal Home sweet home <p><cite>Day 11 at home (Ohio, USA)</cite></p><p>Only gained 1 pound so far. Had expected to gain 5 upon entering U.S. airspace, so relatively satisfied.</p><p>3:00pm and haven't even showered yet. Drinking a syrupy "caramel latte" energy drink. Going to go to "the mall" soon, probably watch a movie. $4 compared to the $15 that I pay in Geneva -- yeehaw, Invisible Hand bless America (that joke is for Aristotle, though I doubt he reads this). Whether I see Untraceable or Rambo (has it really come to this?), I'll leave to the mall gods. Neither can be as bad as Meet the Spartans, in any case.</p><p>Have only checked email and my precious <a href=""> <code>use Perl;</code> </a> for the last two weeks -- done nothing programming-related whatsoever. Really burnt out. Hoping to be sufficiently rejuvenated soon and work a bit on <a href="">Bricolage</a> stuff before going back to work, as have neglected it for a couple months now.</p> slanning 2008-01-28T20:08:17+00:00 journal Dive into Python I'm reading "<a href="">Dive Into Python</a>" over the holidays (Christmas, in case you missed it). I'm getting tired of struggling with porting <a href="">Ogre</a> to Perl, when it seems that <a href="">Python-Ogre</a> has an easy time with it due to existing libraries like <a href="">Py++</a>, <a href="">Boost.python</a>, and <a href="">pygccxml</a>. I don't think I can compete with that. And at the least, I could use their gccxml parser. slanning 2007-12-24T22:53:18+00:00 journal Perl Ogre summary and screenshots so far <p>I took screenshots of all the <a href="">Perl Ogre</a> demos. It gives an indication of how the project has progressed over the past few months. Although screenshots are insufficient for animation or sound demos, I give explanations and you can use your imagination. If you want to try them, install the Ogre modules from <a href="">CPAN</a>. Most of these demos are originally from <a href="">OGRE tutorials</a> or the samples that come with <a href="">OGRE</a>, <a href="">OgreAL</a>, and the <a href="">OGRE wiki</a>, so you could just install those as well.</p><p> <a href="">Robot</a> <br> This is the first thing I made work in Perl with OGRE 3D. It loads a robot mesh and attaches it to a scene node, then rotates and scales it. It's a minimal app that doesn't even handle input, so in order to exit you have to close the window then Ctrl-C.</p><p> <a href="">Ninja</a> <br> The ninja demo adds lighting, shadows, and a textured plane, and handles input of the Esc key to quit the app. </p><p> <a href="">Listening ninja</a> <br> This is the same scene, so the same screenshot, but the demo shows how to use the FrameListener interface to listen for user input events (still only the Esc key). It does this through "unbuffered" input, which means that events are processed by callbacks immediately.</p><p> <a href="">Buffered ninja</a> <br> The same ninja but no distracting background, and now we see his back. This demo shows how to do "buffered" input, and was the first one to use the Ogre::ExampleApplication and Ogre::ExampleFrameListener framework (used by the C++ OGRE tutorials). You can move the camera around with the arrow keys (and PgUp/PgDown) and the mouse when you hold the right mouse button. Pressing 1 or 2 toggles the camera position between two locations.</p><p> <a href="">Space SkyBox</a> <br> A SkyBox is a texture that's applied to a big box in the background. This demo shows a space scene with planets and stars. In the foreground there's a terrain that has shadows. The camera can move about freely as before.</p><p> <a href="">Dark SkyPlane</a> <br> A SkyPlane is the same idea as a SkyBox, but the texture gets applied to a plane instead. If you can never see below a terrain, then you don't need a whole box. This one is really evil looking and reminds me of <a href="">Oblivion</a>. There is also a dark, exponentially increasing fog.</p><p> <a href="">Robot animation</a> <br> This was the first demo where objects in the scene actually moved without moving the camera. The robot has a "Walk" animation which he does on the way to the first waypoint, at which point he gets rotated with a Quaternion to face the last waypoint and continues walking. After reaching the last waypoint, he executes the "Idle" animation, which is what you see in the screenshot. Except it's not moving.</p><p> <a href="">Robot dance</a> <br> This is meant to demonstrate adding an Ogre render window to a Gtk2-Perl application. It's a neat idea in principle, but isn't working too well yet. Whenever you click the Gtk2::Button labeled "Dance!", the camera toggles to the opposite side of the robot, giving the impression that the robot flipped around. Sorry to spoil it if you thought the robot really danced. (One step forward and two steps back?)</p><p> <a href="">Camera tracking</a> <br> Here the camera zooms around, while always tracking (looking at) the ogre head. The interesting part is setting up the camera movement. To do that, an animation is created with a few "key frames" (waypoints at a certain time), and the animation does a spline interpolation between those points. It therefore <a href="">swooshes around like a bird</a> rather than jumping from point to point as in the robot dance demo. (The reason the background gets white is there is a fog applied.)</p><p> <a href="">Particle Effects</a> <br> This is the most spectacular demo. There are <a href="">two "fountains" rotating around beneath the ogre head</a>, showering particles; flat, smoky rings rotate and rise up around him; rain is falling (easier to see when you <a href="">point the camera upward</a>); and bright green blobs of light bubble up from him.</p><p> <a href="">Skeletal animation</a> <br> This has ladies, called "jaiquas", sneaking around wearing some kind of futuristic diving suits. They start out around a circle rotated by 60 degrees each one with respect to the next. Each animation is started at a slightly (randomly) different time, and moves at a slightly (randomly) different rate, giving more of a choatic feel as opposed to if they all did the same animation in lockstep. If you press the 'r' button (which you can do with any demo based on ExampleFrameListener), everything is <a href="">shown in wireframe</a>, giving a kind of <a href="">Tron-like appearance</a>.</p><p> <a href="">Terrain</a> <br> Normally I'd put this after the SkyBox demos, but I want to keep things chronologically ordered here. In the sky demos, you can move the camera freely about, as if it was mounted on a helicopter; you can even pass through the terrain. In this demo, the camera is constrained to always be 10 units above the terrain, so it is more like the camera is mounted on a (very smoothly riding) land vehicle. It reminds me of the 3D battle scenes in the game <a href="">Medieval: Total War</a>. The way it works is by using a RaySceneQuery. The ray (long arrow starting from a point) starts at the camera and goes downward, at some point intersecting with the terrain. The scene query part tells you where this intersection is, so you can then update the camera position to always be 10 units above it. It's not as inefficient as it sounds; as you can see in the screenshot, the scene is being updated 330 times per second (with a terrain and fog).</p><p> <a href="">Lighting and ribbon trails</a> <br> The ogre head again, now floating in outer space, with shiny lights slowly buzzing around him. The animation of the lights is similar to the camera track demo above, with spline interpolation. The lights are so-called RibbonTrails, which are a stream (trail) of small Billboards. (It's a surprising fact that particle effects are mostly based on billboards: lots of little billboards.) </p><p>At this point I made <a href="">Ogre::BetaGUI</a> (more accurately, I ported it to Perl from C++), which is used in the following three demos merely to provide a mouse pointer.</p><p> <a href="">Robots on a terrain</a> <br> (There's a pun I'll make related to a movie featuring snakes and a "plane" if I can ever figure out how to create a snake mesh in Blender.)<br> This demo builds on the terrain demo. First of all, there is now a mouse cursor that you move around. When you click the left button, a robot appears there. If you hold the button down, you can even drag the robot around. Keep in mind that the mouse is moving in a 2D plane while the robots are being placed in 3D, so we end up using a "getCameraToViewportRay" method to do a RaySceneQuery similar to the one for clamping the camera to the terrain.</p><p> <a href="">Robots and ninjas on a terrain</a> <br> Robots versus Ninjas! This demo works the same as the previous one if the mouse is not over a robot; however, if the mouse is over a robot, the robot will be selected and you can drag it around again. It's the same story with RaySceneQueries. A white box shows which one is selected. In addition, you can toggle (with the space bar) whether to place ninjas instead of robots, though the ninjas are scaled wrong so they're like three times the size of the robots.</p><p> <a href="">Robot selection by volume query</a> <br> Unknown to the ninjas, the robots are building a <a href="">clone army</a>. This demo shows the PlaneBoundedVolumeQuery and also how to make a good old rubberband box used for selecting multiple objects with a mouse. In the screenshot, I show the scene after I've already made one selection of robots, and I'm now dragging a box around to make another selection (but haven't let up the mouse button yet). (Note: the implementation of the Perl binding is currently a little sucky if you look in performSelection of examples/ </p><p>At this point I made <a href="">Ogre::AL</a> (binding for OgreAL C++ library). The following three demos are of that, though of course you won't be able to hear the sounds.</p><p> <a href="">OgreAL basic demo</a> <br> Background music is playing, something by or for or from "ZeroFactor". The ogre head, floating in mid-air as always, is "roaring". Whereas the music stays at the same volume and appears to come from nowhere, you'll notice the roaring comes from the ogre. If you turn the camera to the left, the roar moves to the right. If you move the camera back, the roar gets quieter like it's moved off in the distance. </p><p> <a href="">Directional demo</a> <br> There is a siren, which you can turn on and off. It rotates when it's on, and the sound gets weaker when the horn points away from you. To be honest, it doesn't seem realistic at all. Basically it suddenly decreases in volume when the direction it's pointing in is inside the 180 degrees half circle facing away from the camera, then it suddenly increases again when it's within the 180 degrees facing the camera. I don't know if the demo just isn't finished yet, or if the <a href="">OpenAL</a> library sucks on Linux, or what. <b>UPDATE:</b> the author of OgreAL, Casey Borders, says that <a href="">this is a Linux-specific problem</a>. </p><p> <a href="">Doppler demo</a> <br> This demo is also disappointing. The car goes around in a circle, but the sound isn't very....dopplery. When I think of a <a href="">doppler effect</a>, I think of race cars whizzing by or police sirens as the cop car <a href="">speeds past</a>. (Again, I don't know if it's the demo itself or the OpenAL library or my particular system. <b>UPDATE:</b> see update for previous demo.) This demo also has a <a href="">more involved example of using Ogre::BetaGUI</a>, which you can see in the upper-right corner. Clicking the arrow buttons adjusts the doppler effect and speed of sound (in principle, at least...). </p><p> <a href="">Manually drawing shapes</a> <br> Now back to Ogre, not Ogre::BetaGUI or Ogre::AL. I haven't even uploaded this one to CPAN yet. It shows how you can draw shapes "by hand" rather than creating them in Blender (not that I know how to do that). There is a square, a line, a circle, and an annulus (disk with a hole in it). The first three are pretty basic, you just give the positions of the vertices and that's about it (ok, for the circle you have to give a lot of vertices, but the idea is the same). The annulus, on the other hand, is slightly more involved; you have to draw triangles (in fact, quads made of two triangles each) to create the thickness. If you <a href="">look behind the annulus</a>, you'll see that it's only visible from the front. That's because the "normals" to the triangles are pointing toward the front, and the light only reflects that way. (You can easily adjust the "circle_thick" function in examples/ to also add all the triangles in reverse, then it will be visible from both sides.) </p><p>And that's all the demos for now. In the next few months I hope to continue wrapping more of the Ogre API and clean up that module a bit (it's starting to get out of hand, I need to factor out some of the typemapping at least, and figure out how to load each module separately if that's possible). I'm also looking around at physics/collision engines, in particular ones with Ogre bindings such as <a href="">nxOgre</a> (PhysX), <a href="">OgreODE</a>, and <a href="">OgreBullet</a>. The simpler the API the better, and they have to work on Linux.</p><p>There was also a guy on the <a href=";task=view&amp;id=16">#ogre3d IRC channel</a> who mentioned that he was <a href="">embedding perl</a> into his (otherwise C++) game engine and then basically wrapping <b>some</b> useful parts of Ogre in <a href="">XS</a>. It's something I've been thinking about, whether it's worth it to continue wrapping so much in Perl when in fact I'm not sure if I would ever use it myself if I actually made a game. </p> slanning 2007-12-16T20:24:03+00:00 journal Ogre::AL - 3D audio I uploaded a module Ogre::AL to CPAN a little while ago. It allows you to attach sound to scene nodes in OGRE 3D, so you hear the sounds coming from their location within the scene. You can play sounds not attached to nodes, too. slanning 2007-12-15T20:04:16+00:00 journal OGRE3D Perl screencast <p>I made a <a href="">screencast/desktop capture</a> ("Telecharger ce fichier", bottom right - link valid 30 days) of the <a href="">OGRE 3d</a> demo I'd planned to present at the <a href="">French Perl Workshop</a> (I didn't go <a href="">because of a transportation strike in France</a> and bad communication on my part).</p><p> <b>N.B.</b> The resolution sucks and the animation is jerky. That was due to the <a href="">screen capturer</a> (that running at the same time as the demos overloaded my CPU I guess, or maybe the X server), not due to Perl; normally they run smoothly and look much better. If you want to see for yourself, install <a href="">the module</a>.<nobr> <wbr></nobr>:)</p> slanning 2007-11-18T21:39:22+00:00 journal Ogre again <p>It took about 2 months to get another release of <a href="">Ogre</a> out, but there it is finally. I was stuck trying to make a script to generate all the XS for the whole API and went down a few dead-ends.</p><p>I've added three examples, all ported from OGRE's sample applications in C++. One zooms the camera around while keeping it tracking on an Ogre head. A second one is a really pretty particle-effects demo, like fireworks or particle "fountains". The third shows "skeletal animation", and is really cool how the ladies creep around.</p><p>The next demo I'm working on is showing how to make the camera (or whatever scene node) maintain a constant height above a varying terrain (the "Terrain" sample application in OGRE). That uses "ray queries" which are just vectors pointing down from the object and you query whether the vector pokes through anything (in this case the terrain). The demo puts me in the mind of "Medieval: Total War", the 3-d battle scenes (except without any units or anything).</p> slanning 2007-11-16T20:03:27+00:00 journal mod_perl2 I've wasted so many hours trying to port <a href="">Bricolage</a> to <a href="">mod_perl2</a>, and it's still not there. Me hates. slanning 2007-10-16T14:21:07+00:00 journal gcc-xml <p>For my current library-wrapping project, I want to automate more of the bindings generation. It's a C++ library, so I'm parsing C++ headers. At first I did that kind of manually, which wasn't pleasant. Then someone pointed me to <a href="">gcc-xml</a>, which does indeed parse the C++ headers and outputs an XML file. A 25MB XML file, in fact, for the particular headers I used it on. The XML file is fairly easy to figure out, though following (dereferencing) all the ID numbers pointing to other elements is tedious.</p><p>So, two purposes: 1) Let people who've never heard of gcc-xml know about it. 2) Ask if there is anything else people use to (help) parse C++ headers.</p><p>Third purpose: ultimately I'll only have a sloppy, one-off XSUB generator for my specific needs. I'm suggesting, then, that someone, like a university student with too much time and more l33t C++ and XS skillz than me, might find it an interesting project to look into generalizing this to automate generation of Perl bindings for any C++ library.</p> slanning 2007-09-19T12:30:46+00:00 journal Ogre in gtk2-perl and wxPerl (almost) <p>In the release of <a href="">Ogre that I just uploaded</a>, there's new support for embedding Ogre in gtk2-perl and wxPerl. I don't have enough minutes to go into it now, but here's a picture: <a href="">robot dancing</a>.</p><p>Basically, Ogre is focused on graphics, so it requires other libraries to do things like user input. I wrapped OIS for that, but for making better GUI apps it's cool to be able to integrate with Gtk or wxWidgets. I want to look at SDL also. Further down the line, maybe OgreODE as a physics engine.</p><p> <b>UPDATE:</b> I meant to add that the wxPerl support isn't quite working, or at least the example isn't. Also, I'm not sure if <a href=""> <code>gtk_widget_get_parent_window(widget)</code> </a>is correct to call; I just copied it from what I found online, but it seems to get the wrong "parent" window. I need to work on the examples more. I'd like to get something like the <a href="">GtkOgre widget</a> working for gtk (it's pretty complicated to work out how to convert from C to Perl, though...). The wx example is (intended to be) a direct port of <a href="">this WxOgre tutorial</a>, but isn't working right yet.</p> slanning 2007-09-16T20:10:41+00:00 journal Perl book sales On the <a href="'s_mailing_list">POE mailing list</a>, <a href="">someone guessed</a> that books like "<a href="">Perl Best Practices</a>" and "<a href="">Perl Hacks</a>" have probably sold 2000 copies max. Is it true? I wouldn't've guessed they are best-sellers, but that seems really low.... (Are you sure Perl isn't dying?<nobr> <wbr></nobr>:)<nobr> <wbr></nobr>:) slanning 2007-09-13T11:06:53+00:00 journal