Orientation helper scene node

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
sunside
Posts: 9
Joined: Tue May 25, 2010 4:13 pm

Orientation helper scene node

Post by sunside »

Here's an orientation helper scene node. It's nothing big, but I needed it for debug purposes and so I thought, I could as well post it here.
It displays a cube with three differently colored arrows, pointing in the X, Y and Z direction of the node.

Image

Picture is here, http://twitpic.com/1s65fg/full in case the image url changes. In the upper left is a second rendering (RTT) that shows the rotation of the main camera, which is what I needed it for.

Code is here: http://pastebin.com/GuW0ZP7p
For the sake of simplicity, it's under a Creative Commons Attribution Unported license. Basically: Use it whatever you need it for.

The class includes a helper function that rotates the node so that it's Z axis matches a given direction, either given directly or taken from a camera.

Maybe it is of some use to somebody. :)
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Hey thanks. Much appreciated. :)
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

Kewl.
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
Post Reply