Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Oct 2012
Offline Last Active Sep 26 2014 09:42 PM

Posts I've Made

In Topic: Calculating objects direction scene graph

07 September 2014 - 07:59 AM

Thanks got it!


I ended up doing this for anyone interested:

glm::vec3 Entity::getDirection(void)
  if (parentEntity == NULL) {
    return transform.getDirection();
  } else {
    return glm::normalize(glm::vec3(parentEntity->worldMatrix * glm::vec4(transform.getDirection(), 0)));

I think I made the mistake where my vectors representing directions did not have a 4th component of 0 and were being translated. Also I needed to normalise the vector as scaling was affecting the magnitude.

In Topic: Spherical coordinates for orbital motion

05 October 2012 - 09:51 AM

So any suggestions as to how I should go about manipulating phi and theta correctly to achieve the orbit in the second picture?