Thursday, April 18, 2013

This Lagoon is Buh-Loo



I'm most the way through chapter ten of Blender 3D Basics and this is the little island scene I've crafted as I've completed the tutorials. The textures could use a massive amount of work, the waterline is extremely unrealistic and the water texture isn't very believable either. Having said all that, I still enjoy looking at that shoddy little shot and thinking, "I made that."

I'm looking forward to the next chapter: Improving your Camera and Lighting Work

Tuesday, April 16, 2013

Displaying an image stored in MSSQL via Quercus PHP

I know, not exactly thrilling stuff here, but I figured I'd throw a bone to anyone else out there in the interwebs who might struggle in like manner.

I'm not entirely (or even remotely) sure why, but the version of Quercus I'm using (4.0.25) is returning (using PDO for database interaction) my image column (type: Image, MSSQL 2008) as a hex encoded string (instead of binary which is what I'd expect). That means, all the example code out there in the interweb that instructs you to return an image thusly was not working for me:

No Worky
<?php

//  PDO stuff 
//  ...

$image = $results['Image'];
header ('Content-Type: image/jpg');
echo $image;

?>

Once I realized that php was handing me back the image data as a hexadecimal string I just had to figure out how to convert that to a binary string. PHP versions 5.4 and later have a function named hex2bin but alas Quercus 4.0.25 implements PHP 5.3.2. Have no fear; pack to the rescue! My new and improved (as in working) code shown below.

Worky
<?php

//  PDO stuff 
//  ...

$image = $results['Image'];
header ('Content-Type: image/jpg');
echo pack('H*',$image);

?>

Next up.... something else (hopefully a little less stuffy)

Thursday, April 11, 2013

It's Slooping!

Sloop update. I've made it to chapter ten of Blender 3D Basics. As far as I know, modeling the sloop is now complete. The tasks that lay ahead include creating an environment for the sloop to do it's slooping, and improving camera/lighting aspects.

I haven't been highly diligent in working my way through this book lately as I've been heavily distracted by trying to learn the jMonkey Engine. It's been a lot of fun but I still have a huge knowledge gap to traverse.

At some point,  blender and jMonkey are going to converge for me - I'll be using blender to create assets for whatever madness I cobble together using jMonkey. I'm not quite there yet, but I'm hoping a few more months down the road will prove fruitful.

Monday, April 8, 2013

Adventures in Ubuntu Land

Maybe "Misfortunes in Ubuntu Land" is a more accurate title. I guess it all depends on attitude.

Recently, I attempted to update the graphics driver on my ubuntu machine. There were several good reasons to undertake such a task.
  • I recently installed the steam client and was hoping to get as much performance out of my GTX560Ti. 
  • Along those same lines, I've been doing some basic development with jMonkey on a different machine and wanted to see how it runs on my ubuntu box.
  • I tried using VLC to create desktop videos on ubuntu. VLC appears to be recording and saves a file, but when I try to watch it: wham! 'unknown file encoding' error. I was hoping that perhaps a video card driver update might miraculously solve that issue as well.
  • YouTube video quality seems sub par when watching on my ubuntu box and I thought a video driver update might also prove to be beneficial in that regard.
Despite all these fantastic reasons for running on the latest and greatest nvidia driver for my card, I was thwarted in my attempts. Here's what I tried. It wasn't terribly tricky, but notwithstanding, mah machine got borked!

System Settings -> Software Sourcess -> Additional Drivers (tab)

I picked the top most option (since 'tested' seemed like a safe bet). After selecting the new driver and clicking apply changes, nothing seemed to be visibly different, so I rebooted.


Upon login, I noticed both task bars (left and top) were no longer present (although my two desktop icons still showed). Ctrl-Alt-t brought up a terminal, from which I launched chrome, intent on searching the internet for some clues.  As soon as Chrome came up, the gui manager (unity?gnome?) took a turn for the worse, and my keyboard input no longer functioned in either the browser or the terminal. Help!

Luckily, Ctrl-Alt-F1 still dropped me into the gui-less console where I was able to run the following command:
 sudo apt-get remove nvidia-current
Once the prompt promptly returned, a command line reboot brought me back up happy as can be, back from the dead. I plan to attempt the driver reinstall again at some point in the future, but after I've done some more thorough research on the matter. Until then, we'll just keep things nice and vanilla.

revert an nvidia driver     revert from ctrl-alt-f1