Skip to main content
added 2 characters in body
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123

Try to look in this waway:

Vector3df sundirection = sun->GetDirectionTo();
Vector3df rotaxis = normalize( cross(Vector3df(1, 0, 0), sundirection));
double angle = acos(dot(Vector3df(1,0,0),sundirection));
Quaterniondf orient(angle, rotaxis);

Try to look in this wa

Vector3df sundirection = sun->GetDirectionTo();
Vector3df rotaxis = normalize( cross(Vector3df(1, 0, 0), sundirection));
double angle = acos(dot(Vector3df(1,0,0),sundirection));
Quaterniondf orient(angle, rotaxis);

Try to look in this way:

Vector3df sundirection = sun->GetDirectionTo();
Vector3df rotaxis = normalize( cross(Vector3df(1, 0, 0), sundirection));
double angle = acos(dot(Vector3df(1,0,0),sundirection));
Quaterniondf orient(angle, rotaxis);
Source Link
qmor
  • 101

Try to look in this wa

Vector3df sundirection = sun->GetDirectionTo();
Vector3df rotaxis = normalize( cross(Vector3df(1, 0, 0), sundirection));
double angle = acos(dot(Vector3df(1,0,0),sundirection));
Quaterniondf orient(angle, rotaxis);