LWJGL
May 24, 2013, 02:31:35 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Obtaining a unit directional Vector3f from a Matrix3f  (Read 610 times)
Maykin53
Newbie
*
Posts: 10


« on: October 21, 2011, 23:56:49 »

Hello all.
In my program, my light sources are defined by:

Vector3f location
Vector3f direction (unit directional vector. ie. 0,0,1 for looking down the Z axis away from the screen)
Vector4f color

my third person camera is defined by a set of vectors for view, distance, rotation, and orbit - all from which a Perspective Matrix (Matrix4f) is obtained and passed to the shader.

Both my lights and my camera work fine.

However, the problem I have is that I want to create a light source that's direction is always the same as the camera's (ie. the camera's Orbit Vector3f).
I'm not sure how to convert from a rotation vector or matrix4f to a unit directional vector. Does anyone know how this is done?

Basically I want to have my light's direction the same as my camera's orbit.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!