I'm trying to write Julia Quaternion for VRay, so far I've gotten the basics to work:
http://www.niksula.cs.hut.fi/~jylila...ayJulia_02.jpg
However I'm having some trouble with object transformations.
I have
Vector rayp = worldToObj * ray.p;
Vector raydir = worldToObj * ray.dir;
Before the intersection calculations and
Vector hitPoint= objToWorld * localHitPoint;
Vector normalDir= objToWorld * localNormalDirection;
After the intersection calculations are done and I want to return intersection results.
This works fine for rotation and scaling. However it doesn't seem to give me correct results in translation, if I move the object even a little, it seems to move a lot, like ten to fifty times the amount I move it in viewport.
I get the tranformation matrixes used above like this:
objToWorld=toTransform(node->GetObjTMAfterWSM(t));
worldToObj=objToWorld.makeInverse();
- Jerry Ylilammi
http://www.niksula.cs.hut.fi/~jylila...ayJulia_02.jpg
However I'm having some trouble with object transformations.
I have
Vector rayp = worldToObj * ray.p;
Vector raydir = worldToObj * ray.dir;
Before the intersection calculations and
Vector hitPoint= objToWorld * localHitPoint;
Vector normalDir= objToWorld * localNormalDirection;
After the intersection calculations are done and I want to return intersection results.
This works fine for rotation and scaling. However it doesn't seem to give me correct results in translation, if I move the object even a little, it seems to move a lot, like ten to fifty times the amount I move it in viewport.
I get the tranformation matrixes used above like this:
objToWorld=toTransform(node->GetObjTMAfterWSM(t));
worldToObj=objToWorld.makeInverse();
- Jerry Ylilammi
Comment