Thread Previous • Date Previous • Date Next • Thread Next |
Uh, what about the case planePt==Vector3r::ZERO? You should add something like:+ Quaternionr normal2pt; + if (planePt!=Vector3r::ZERO) { + Vector3r axis=planeNormal.Cross(planePt); axis.Normalize(); + Real angle=planePt.Length()/radius; + normal2pt.FromAxisAngle(axis,angle); + }
else { return Quaternionr::IDENTITY; } (Just from the top of my head, I cannot compile & check the code now.) Cheers, Vaclav
Thread Previous • Date Previous • Date Next • Thread Next |