Gilles De Mey

« Ramblings from a concise equine »

Debugging axes in three.js

Some of the issues I’ve encountered when I started playing around in three.js, is debugging my axes.

They visualize the position and orientation of meshes and the GridHelper (currently undocumented) helps me to debug my camera perspective.

If you’re on the latest version of three.js (r58) I can help you with that pesky problem.

In foolishly attempting to create a 3D game, I created a utility class that has a few simple functions to help me debugging.

Usage:

THREE.utils.enableDebug( ) takes two kind of arguments. It takes a THREE.Scene object to enable BoxHelpers and AxisHelpers on every mesh in the scene.

It also take a THREE.Mesh object in case you only want to debug a single object.

THREE.disableDebug( ) does the exact opposite, and takes the same kind of arguments.

The code is freely available on GitHub, if you have anything to contribute don’t hesitate to send a pull request!

https://github.com/gillesdemey/dungeongl/blob/master/game/utils/debug.js

Check out a demo below:

As much as iCloud is the right idea still not realized, Dropbox is the wrong thing done brilliantly well. And at the end of the day, that still amounts to the wrong thing.

http://www.imore.com/stuck-between-dropbox-was-and-icloud-isnt-yet

Virtual Pants: Surface Pro "sells out"

virtualpants:

When new products sell out on launch day it usually means one of two things: it’s a hot product or they didn’t make enough. Unfortunately for Microsoft, it appears that the Surface Pro falls into the latter category. (…) The local Best Buy sold out too, but only received one unit. The local Staples received and sold a whopping two units.

3 months ago - 5

An interface should get out of the way, except when it shouldn’t.

3 months ago

From jQuery to JavaScript and back again.

3 months ago

Time for a Forward Thinking CMS.

3 months ago

Stop Misusing Select Menus.

3 months ago

Your app won't save the world.

3 months ago

Typewriter.js

A cool javascript file I wrote that can cycle through an array of sentences and simulate someone typing and erasing them.

I also has a few other functions and things it can do.

You can find instructions, the source (and a minified version) on Github.

https://github.com/gillesdemey/typewrite

Configuring PHP, Apache & MCrypt on OS X Mountain Lion

After many hours of teeth gnashing, I’ve managed to get the latest version of PHP (5.4.11 at this time of writing) working with the built-in Apache version on Mac OS X 10.8.2 (Mountain Lion) and libmcrypt.

Since I’ve decided to give the Laravel framework a try, I had to have libmcrypt and the PHP MCrypt extension since that is a requirement of the framework.

Here is a quick rundown to help you out.

Prerequisites:

Make sure you update to the latest Command Line Tools for Xcode!

You can download it at https://developer.apple.com/downloads/

Requirements:

Step 1: Downloading packages

Go ahead and download the latest version of PHP from the site 

http://php.net/downloads.php#v5

Also download the latest version (2.5.8) of libmcrypt, not mcrypt.

http://sourceforge.net/projects/mcrypt/files/Libmcrypt/

Step 2: Compiling

Unpack both PHP and libmcrypt with your favorite unpacker, or use the terminal command.

tar xvzf php-5.4.11.tar
tar xvzf libmcrypt-2.5.8.tar

Start configuring and compiling libmcrypt, but not PHP.

./configure
make
make install

Install PHP 5.4.x via Homebrew. Since it’s not in the default tap, you’ll have to use some terminal commands to get to the apache-php tap.

Punch in 

brew tap homebrew/dupes

to get to the tap which holds some of the dependencies. Then run the following:

brew tap josegonzalez/homebrew-php

Now we can install PHP 5.4.11 via homebrew. To do so, run

brew install php54

Let it do it’s thing, it might take a while.

Step 3: Configuring Apache

Open up your apache configuration file in 

/private/etc/apache2/httpd.conf

and change the line of your php5_module to

LoadModule php5_module    /usr/local/Cellar/php54/5.4.11/libexec/apache2/libphp5.so

Good now Apache will use the PHP version we installed via homebrew.

Now edit your Bash or ZShell PATH, and add this line

export PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"

Restart your terminal and verify that your shell is using the PHP binary you installed through homebrew via

which php

It should point you to

/usr/local/opt/php54/bin/php

Step 4: PHP MCrypt extension

Go to the PHP version you downloaded via their website and navigate to the

/ext/mcrypt

folder. Punch in the following commands:

/usr/bin/phpize
./configure
make
make install

And you’re done installing the MCrypt extension. Now to tell PHP to use that extension.

Go to the php.ini file located at 

/usr/local/etc/php/5.4/php.ini

and add the following line to the file, under “Dynamic Extensions”

extension=libmcrypt.so

And you’re all done! Confirm that mcrypt is installed by running 

php -i | grep mcrypt

and it should say 

mcrypt support => enabled

image

And now you’re all done, when visiting your Laravel site you’ll be greeted by their welcome page!

image