apoc519
01-21-2006, 09:47 AM
quick question. How would I grab a cameras aim vector? I tried normalizing its rotation but that just doesnt seem to be working for me. Is there a more straight forward way?
My current expression looks like this. Although I'm pretty sure im way off base
//get cameras rotation
vector $camRot = <<persp.rotateX, persp.rotateY, persp.rotateZ>>;
//add rotation values
float $camRotTotal = abs($camRot.x) + abs($camRot.y) + abs($camRot.z);
//divide each axis by the total
vector $camAimNormalized = <<
$camRot.x / $camRotTotal,
$camRot.y / $camRotTotal,
$camRot.z / $camRotTotal>>;
My current expression looks like this. Although I'm pretty sure im way off base
//get cameras rotation
vector $camRot = <<persp.rotateX, persp.rotateY, persp.rotateZ>>;
//add rotation values
float $camRotTotal = abs($camRot.x) + abs($camRot.y) + abs($camRot.z);
//divide each axis by the total
vector $camAimNormalized = <<
$camRot.x / $camRotTotal,
$camRot.y / $camRotTotal,
$camRot.z / $camRotTotal>>;
