Sunday, December 16, 2007

Cleaning My Black MacBook

I just stumbled upon the best way to clean the smudges off my black Macbook: a simple wipe-down with a Kitchen Millenium microfiber dishcloth. I received mine as gift from Sherry a while back, so I don't know where she found them. I put a little water on one and wiped down the screen, the case, and the keyboard. Thirty seconds later the smudges were gone, and without the need for chemicals.

Monday, August 06, 2007

jME Camera Cropping

I've been having an issue with culling when using a fixed camera. When I try to position the camera so that it has a good perspective on the course, moving the marble to various parts of the course cause either (a) the marble to disappear or (b) part of the course to disappear. This doesn't happen when I use the chase camera.

A little experimenting suggests that I may have been positioning the camera in an invalid manner. I was using cam.getLocation().set() and cam.setDirection(). The problem seems to go away when I instead modify cam.getLocation().y and call cam.lookAt().

Update 2007-08-08: I immediately ran into problems with Camera.lookAt() in that the method seems to point the camera at the specified location by first tilting the vertical axis along the z-axis and then swiveling the camera left or right as required. This poses no problem when looking at an object ahead of the camera, but if the camera actualy has to look to the left or right, the image appears tipped over. For a while I went back to fiddling with adjusting the camera axes and direction manually but ultimately gave up; if I want to figure out how to point the camera without culling side-effects I'm probably going to have to study the lookAt method source code. I ultimately was able to get lookAt to work by specifying a top (argument 2 of the lookAt method) that points the camera in the direction of the target, so no left or right swivel is required.

jME CVS Update

I decided to update my jME source code from the CVS repository in case the weird culling behavior I've been seeing is the result of a jME bug that's been fixed. I selected CVS > Update all files. This ran for a while. But then when I tried to do a Clean and Build Project on my marble game I got all sorts of errors. Selecting "Resolve Reference Problems" from the project right-click menu revealed a long list of missing jars. Then I remembered that there was an extra step to get jME into jars instead of class files: right-clicking on the jME build.xml file and selecting Run target > dist-all. That seems to have cleaned up the broken references.

The next problem: two compile errors regarding LoggingSystem.getLogger(). According to the JavaDoc class LoggingSystem is deprecated; it looks like it no longer has any methods. The doc suggests using Java's Logger class instead. I modified my code by following the example in TestMarble.java.

Everything is fine now. Except the culling issue has remained. :o\

Saturday, July 28, 2007

jMonkey Camera Vector3f Gotcha

I was seeing some crazy behavior when applying force to my marble according to the current camera orientation. The marble would just shoot off as if force being applied the marble were suddenly increasing exponentially. After lots of System.out.println'ing I discovered that Camera.getDirection() and Camera.getLeft() do not return new Vector3f instances but pointers to the actual instances! So when I thought I was only changing the force quantity, I was in fact changing the actual camera properties. I was able to fix this by using Vector3f.clone().

Wednesday, July 25, 2007

Problems with jMonkey and Collada

I created a simple model (a cube) in Blender and exported it to both Collada and MD2 formats. I can get both models to load and appear, but the Collada one has strange culling effects (it acts like it it's a high-level node, making big chucks of my level disappear when it's out of view). For now, I'm going with MD2.

I found the Blender 3D Noob to Pro tutorial indispensable.
 
By the way, I couldn't get either to work in jME until I had performed UV mapping on my model, which apparently gives the information necessary to apply textures. Blender doesn't let you export to MD2 until this is done, whereas it let me go ahead and create a Collada file that loaded but displayed a messed up model in jME.

Monday, July 23, 2007

jME Gravity

Gravity seemed a bit sluggish to me so I poked around and found out how to tweak it: method PhysicsSpace.setDirectionalGravity. I ended up with a Vector3f set to 0, -50, 0, which looks about right for Earth gravity given the scale I'm imagining everything at.

jME Game Time

I tried running my test application on my reasonably fast Windows desktop, and it runs quite a bit differently than on my MacBook. While the physics seems to get updated at the same rate, the logic seems to run faster. In my case, this means a higher rate of acceleration can be applied to the marble, presumably because there are more applications of torque per second. It is, of course, essential that the internal clock of a game is paced with real-time so that game-play is consistent across machines.

I found a good thread on the forum addressing this issue. It appears that there are at least two ways to handle this. One is by using a built-in multiplier -- time-per-frame (tpf) -- when doing things like updating player positions. The other is by using FixedLogicRateGame. This second approach won't work for me -- I'm extending SimplePassGame -- but I may be able to add functionality from this class into my own.

For now I'm taking the easy approach: adding tpf as a multiplier when torque is be applied to the player. After tweaking the numbers to get the behavior I wanted on my Mac, I tested it on my Windows desktop. Both systems now behave identically.

jMonkey App Distribution

Because I'm curious to see how my little jMonkey Engine application runs on a different machine, I decided to try packaging it up. I started by following the guide to using jME with NetBeans that I referenced in an earlier post. It got me most of the way there, but it has a few notable omissions.
  1. "Put all your images and 3D data files into JARs too." On my MacBook, this involved using Spotlight to find the image files referenced in my code and then manually copying the files into my project folder. I copied mine into the source directory, right next to the .java file, although I imagine you could put them elsewhere. Within seconds, the files appeared in my NetBeans project view. When I modified the textureState.setTexture calls I used the name of my game class and just the file name with no path (because the image files are in my source folder).
  2. Add the native LWJGL library to your dist folder. This tip I got from a discussion on the forum. For OS X, that file is liblwjgl.jnilib; I used Spotlight to find it.
  3. Add the native ODE library to your dist folder. Another tip from the forum. For OS X, the file is libodejava.jnilib.
Note that for the game to be cross-platform, the Windows and Linux flavors of the native LWJGL and ODE libraries should be included, too.

I'll try to update the wiki.

Saturday, July 21, 2007

jMonkey Physics Collisions

After much experimentation and a bit of sifting through jME Physics code, I think I have a rough understanding of how to use the collision physics. The issue I ran into was that my marble was rolling on Sphere and Box objects but passing through all the other jME primitive shapes I tried.

Apparently, method PhysicsNode.generatePhysicsGeometry creates the invisible physical boundary of the node based on the associated geometric shape. Calling generatePhysicsGeometry with no argument essentially tells it to use specially optimized boundaries for better collision functionality performance. The trouble is that these high-performance boundaries only works for boxes, spheres, and terrain (I haven't tried this last one yet but the code suggests that it works).

For any other object be treated as solid, the useTriangleAccurateGeometries argument of method PhysicsNode.generatePhysicsGeometry must be set to true. Comments in the jME Physics code state that there's a performance hit. But at least it works.

Tuesday, July 17, 2007

jMonkey

Trying to get the jMonkey Engine (JME) working on my MacBook with the NetBeans IDE. I followed the excellent guide on the JME wiki, and got it compiling and running with only a couple problems.

When I reached section c, I basically followed the instructions, but did not select the option to create a main class. Instead, I created my own package in the project (org.rockridgex) and copied the jME-Physics_2 source file com.jmetest.physics.TestMarble.java into it. I couldn't get this project to run until I added CVS/jmephysics/impl/ode/lib/odejava-jni.jar as a compile library; I have no idea why.

Saturday, June 02, 2007

Armada Back In The Shop

Unc has been using the Armada with BFX for two weeks with very few problems, but the machine has at least two unacceptable issues.
  • Firefox is unstable. It crashes frequently, typically when clicking some random link. I tried installing the Ubuntu build, but that didn't help.
  • Printing isn't working. Unc has an Epson Stylus C60. I added the printer manually (nothing was auto-detected), and at least got the printer to do endless page feeds using the "New Stylus" drivers. But jobs would not cancel from the queue, and it's impossible to remove a printer once one has been added. Overall, the printer utilities seem very beta.
I'm not sure what to do now. I think I need to switch to a different Linux. But which one?

Thursday, May 17, 2007

Another day with Camino

According to the Camino web site, search engines can be added, but there's no GUI for it and it requires editing a file. I bought my Mac to avoid things like that.

New Likes

Camino hasn't frozen or spiked my CPU all day. You can be sure Firefox would have by now.

The multi-tab bookmark can be opened like a regular bookmark folder just by click and holding. This way there's still easy access to individual sites in the folder if you don't want to open the whole set.

New Dislikes

No find bar. I use the Firefox find bar all the time. It's a much more useful implementation of searching within a page than the typical control-F box. I know Camino has find-as-you-type. But i doesn't work very well, in that (a) I hate having to remeber keystrokes like slash, command-G ,and command-shift-G, and (b) find next and find previous operations are only available for a few seconds after a hit.

No form field suggestions. Firefox remembers the values I have typed into a form field. I just bought a bunch of Southwest tickets and I had to type in my girlfriend's email address every time.

Wednesday, May 16, 2007

Camino: Initial Impressions


It wasn't until last night that I finally got around to installing Mozilla's Camino web browser on my MacBook (version 1.0.4). I've been seeing it mentioned more frequently, so it's been on my mind. Given my increasing frustration over Firefox lockups and dirty quits, it's a perfect time to make Camino my default browser, at least on a trial basis.

I like the idea of Camino being more of a "true" OS X application, but I confess that Firefox's lack of "Mac-ness" never really phased me. Integration with keychain? That's nice...I guess. But in my work I am often forced to use client-provided laptops, and it's a big time saver to copy my Firefox passwords -- along with all other settings -- to theses Windows machines. Cross-platform support is one of the big reasons I use Firefox.

I'm also a little nervous about Camino's lack of customization options. To be fair, a better way to say it is that Firefox is outrageously customizable and Camino is reasonably customizable. I'm not a manic consumer of Firefox extensions, but I do have my favorites. And I love being able to add search engines to the search control; I'd be more willing to use Safari if it had this feature. Nevertheless, I'm willing to give Camino a chance; it does for example, have integrated "annoynace blocking", which I accomplish in Firefox through extensions.

I imported my Firefox bookmarks easily. I was a little surprised, given their common heritage, that Camino didn't provide an option for importing other settings from Firefox, especially passwords.

The first feature that I love: multi-tab bookmarks. A single click on my Camino bookmark bar now populates the window with four tabs containing my favorite websites.

The first feature that I hate: hovering over My Yahoo! news headlines doesn't float an abstract of the story. This could be a deal-breaker.

Monday, May 14, 2007

Compaq Armada M300 And Linux

I had very good luck with BeaFanatix on the under-powered Tecra 550CDT, so that's the first thing I tried on the Armada. Everything went well -- it boots up very quickly from the CD and of course even faster after it's installed -- but I did have Firefox crash a couple of times while on YouTube.

I tried Xubuntu 6.10, and while the Live CD booted fine, the machine wouldn't boot into X11 after installation.

I tried Xubuntu 7.04, but that locked up at 15% during installation.

I tried Ubuntu 7.04, but that wouldn't detect the network card.

Needless to say, BFX is looking pretty good again.

Windows XP On The Shuttle

I've got Sherry's copy of Windows XP installed and activated. Put it on automatic updates mode. It seems to be up to date now with Microsoft fixes.

Installed the audio drivers that I got off the Shuttle ST62K support site; the audio didn't work without them. Also installed the VGA drivers from the site; the scrolling in a web browser was much smoother afterward.

Installed both Firefox and IE 7, and got flash setup for both. Tested watching Grey's Anatomy "fullscreen" at abc.com and it played very smoothly, only stuttering a couple of times throughout the episode.

Installed iTunes, activated Sherry's Apple account for the Shuttle, and imported all of her music from the old computer. The playlists got a little jacked up, but I did an import one of the files in the iTunes directory and that fixed it.

Installed updates for the Pioneer DVR-A09XL DVD drive (updated firmware, and some update that's supposed to make it run more quietly during video playback) taken from the support site. I can't find the CD that came with the drive, so I'm trying to install open source DVD burning software. I installed InfraRecorder and erased an old CD-RW. My only complaint was that the software looked like it had locked up during the procedure -- progress was stuck at 0% the entire time -- but within 10 minutes it popped out the disc and indicated that it had been erased successfully. I burned a copy of Xubuntu 7.04, and according to the log it was "successfully fixated". InfraRecorder's GUI might be a bit quirky.

I noticed that there's no mention of USB 2.0 in the Device Manager. I downloaded the USB 2.0 file from the Shuttle site but it turned out to be a text file containing very brief instructions for getting USB 2.0 to work. They make it sound like I should already see a USB 2.0 host controller in my device manager. The instructions on the Microsoft web site were also decidedly unhelpful.

I went back out to the Shuttle site, grabbed the "chipset driver", and installed it. It installed a few things, but not USB 2.0 support. I downloaded the Shuttle manual (installing Adobe Reader in the process) and it refers to the USB 2.0 installation included on the Shuttle CD...which I seem to have misplaced. HOwever, a little Googling indicates that I may be worrying about nothing; the reference in the Device Manager to "Standard Enhanced PCI to USB Host Controller" apparently means I have USB 2.0 already.

Wednesday, April 25, 2007

The Shuttle Lives!

While fiddling some more with the Shuttle, I noticed that it seemed to be running hot. Then I noticed the case fan wasn't running. I switched the fan connector from its fan header on the motherboard to to the fan header right next to it, and the fan came alive. I verified via some Googling that the Shuttle XPC T62K motherboard is notorious for blown fan headers, and that the only workaround has been switching to one that still works (I'm presumably out of warranty).

Now the Shuttle is performing beautifully, playing several videos simultaneously at high frame rates. I've installed Windows XP with no problems, and am planning on giving the box to Sherry and her boys.

It's amazing how CPU overheating manifests itself. The computer shutting down is one thing, but I never realized it could degrade performance.

Tuesday, April 24, 2007

Resurrecting the Shuttle

My cute, little, white Shuttle XPC (T62K "Zen" barebones, I think) has been sitting in the corner of my office for 6 months, since being demoted from venerated role of house server. It had been running Fedora, but it kept shutting itself off every few days.

Now I'm wondering if I can do something useful with it. My first thought was a computer for Sherry and her kids. But that would require Windows, and I couldn't get through the early stages of the Windows XP installation process without the machine freezing up; I have no idea why.

Now I'm trying Linux to see if I can turn it into a useful machine for Unc. Ubuntu 7.04 Feisty Fawn installed painlessly. The only manual tweak I've had to make was to give myself more options than 640x480 and 800x600. This required editing /etc/X11/xorg.conf and adding in two lines for the horizontal sync and vertical refresh (I got the specs out of the Sylvania F70 user manual, which I fortuitously managed to not lose after 10 years of ownership). A reboot later and I have lots of good resolution options.

But now I'm seeing bizarre CPU pegging, and consistently having Firefox lock up. I tried to log into blogger.com and the page loaded but then the machine started to crawl, to a degree that I was unable to get my login password typed in. I forced Firefox to quit. Loading the NetFlix page produced one of those "unresponsive/slow script warning messages. This is a low spec machine, but it's not THAT bad: 300MHz Celeron, 512K RAM. Something else is going on.

I installed the Adobe Flash plug-in for Firefox, went to YouTube, and the video framerate is bad. What the hell? Rebooting.

Saturday, April 21, 2007

Tecra 550CDT and Puppy Linux

I like the sound of this distribution. The Tecra booted successfully with the 2.14 CD, but the D-Link PCMCIA ethernet card (DFE-690TXD) was not detected. I put in the D-Link wireless PCMCIA card, rebooted, and it wasn't detected either.

I fiddled with the Puppy network wizard but came up empty. It does have an option for ndiswrapper, which is apparently some sort of Windows driver file compatability layer. I downloaded the Windows 2000 driver for the DFE-690TXD on my MacBook, used StuffIt Expander to unarchive it, copied the inf file onto a USB memory stick, put it in the Tecra, and the Tecra doesn't seem to see the stick. Rebooting. Still the USB stick is not being detected. I wonder if the USB port even works.

Burned the inf file onto a CD, but when I try to load it via the network wizard I'm told the driver file is invalid. Tried the Windows XP version, but it still didn't work. Tried the wireless card drivers...no luck.

I think Puppy Linux and the Tecra 550CDT were not meant to be.

Tecra 550CDT and BeaFanatIX

Yesterday I wasn't able to get BeaFanatIX (BFX) to boot on the Tecra, which was weird, given that the same disc booted on a recent model Dell. I did a full erase on the CD (I think I had done a "quick erase" last time), reburned it, and now the Tecra can boot with it.

I don't know if the problem really was the "quick erase" but in the future I need to be mindful that just because a disc boots on one machine doesn't mean the disc isn't bad.

BFX is properly detecting the PCMCIA ethernet card. It's also doing a very good job with the display, at least when it boots with my 17" monitor attached (otherwise it gives only one resolution option, which is way too low).

Everything is performing pretty well, except video (I had to install the Flash plug-in manually). It may be that the Tecra 550CDT simply isn't capable of playing video at an acceptable frame rate.

Friday, April 20, 2007

Tecra 550CDT and Linux, Again

This time I'm trying to build a machine suitable for Unc, a freind of the family in his early 80s. He's got an original iMac upgraded to the last pre-X Mac OS, and it simply isn't cutting it for him. He's unable to open most of the attachments people send him; YouTube videos play like crap.

I never did get Xubuntu 6.10 to recognize the network cards.

I tried Xubuntu 7.04 (Feisty Fawn) but I get a TTY error on installation.

Xubuntu 6.06 Alternate went better. It installed -- slowly -- but immediately recognized both the D-Link wired and wireless PCMCIA cards.

It's really not bad. Only 2 complaints so far:
The performance of YouTube videos: it's bad.
Firefox is pokey. On several pages, including Netflix and Yahoo! Mail Beta the error message regarding long-running scripts pops up several times.

For grins I tried booting the machine with the BFX CD but it wouldn't boot.

I'm wondering how much things will improve if I install a lighter-weight window manager. I installed all the Matchbox packages using Synaptic (after turning on the "unsupported" repositories). A reboot still didn't display Matchbox as an option under "sessions" on the login screen.

Thursday, April 12, 2007

Amazon Unbox under Parallels

I'm trying to get Amazon Unbox working on my MacBook under Parallels. The first problem I encountered was that I didnt have enough disk space for the movie downloads. This is understandable, in that I wanted to keep the Windows partition just big enough for the OS and the odd application.

The first remedy I tried was changing the settings to point to a folder on my "OS X" partition, which to Parallels looks like a network drive. I didn't get far: first Unbox inexplicably wouldn't let me save the settings, but then ultimately gave me an error message suggesting movies can only be downloaded to local drives.

The next approach was increasing the size of my Parallels partition. A little Googling quickly scared me away, however: it sounds like a bit of a painful process.

The next strategy: add another virtual hard drive to Parallels. Problem number one: I couldn't figure out how to edit the virtual machine settings because I had configured Parallels to start the VM automatically upon launching and quit once the VM quit, and a VM's settings can only be modified when the VM isn't running. A lot of Googling led me to a solution: if the command (apple/clover) key is pressed and held immediately after launching Parallels it does not automatically start the VM.

Once I got the VM settings opened, it was easy enough to specify that I wanted another hard drive. But when I launched the VM no second hard disk appeared in "My Computer". More Googling, and I found a solution: the drive has to be formatted. In Control Panel > Administrative Tools > Computer Management > Disk Management I went through the Dynamic wizard that came up automatically. Then I selected something like Action > All Tasks > Add volume and went through that wizard. That did the trick.

Now I've changed the Amazon Unbox settings to point to my "E:" drive...but the movies I bought are still refusing to download. I'll give them time...



The user interface made it look easy enough

Sunday, January 28, 2007

Apache Security On OS X 10.3

Sherry has been unable to view my travel calendar even though no one else has had any problems. Today I figured out why: she's the only one who's been trying to access it using Internet Explorer. Apparently, Internet Explorer 6 is not compatible with the Apache security implemented in mod_digest. Supposedly, a newer version of the module named mod_auth_digest is available, but it is not part of the Apache build delivered with 10.3. Now I'm facing the prospect of trying to upgrade to a newer version of Apache (I think I'm running 1.3 but I'm not sure). No idea how much of a pain this would be. (Thanks to this post.)

Sunday, January 14, 2007

Calendar Hosting On OS X

I maintain my calendars on my MacBook, but I want to share my travel calendar with a few select people. My solution? Host my own WebDAV server. I followed Greg Westin's instructions exactly and now my travel calendar is available for subscription and password protected.

I had hoped that friends could use Google Calendar to subscribe, but that application doesn't seem to support password-protected calendars. So I decided to install PHPiCalendar, an application I have some experience with that renders ical calendars as HTML. That way folks can view my travel calendar by either subscribing to it from within their own calendar program or by going directly to my website.

I was able to follow Greg Westin's instructions for PHPiCalendar almost exactly. The only differences were introduced by my use of PHPiCalendar 2.2.2, the latest version. My first run produced an error: "Unable to write to cache directory. Please check your config." That problem was fixed by setting $tmp_dir to '/tmp' in config.inc.php. Now the calendar displays great...at least from inside the LAN.

Outside access was still not working; it was giving a page can't be displayed error. I modified the httpd.conf file so that the ServerName -- which was not being specified by default -- is set to my actual domain name: rockridgesolutions.com. That did the trick.

Adding password protection was pretty simple, in that the issue is addressed in the FAQ at the end of Greg's document. I decided to simply use the same scheme I defined for WebDAV access, so there was no need to create a new passwords file. It seems to be working, but more testing is required.

As an aside...while performing the configuration, I ran into a problem getting the terminal editor to quit: no matter how I had my System Preferences defined, I couldn't get it to take an F10. I finally got lucky and stumbled upon the Apple-F10 keystroke, which did the trick.

Caipirinha VNC

I now have VNC access to Caipirhina, the old PowerBook G4 12" with a broken screen that has become my home server. To get it working I installed OSXvnc, gave it a password, and turned on the "system server". Now, when it reboots, the server is automatically started in the background.

From my MacBook, I'm using Chicken of the VNC. Starting that application presents me with a list of VNC servers it detects, making it super easy for me to connect.