Hello,
I have a problem and I can not find a solution yet.
The goal is to fit a scene best to the viewing window, regardless of
the scene transformation or camera transformation.
My Idea:
I am calculating a bounding box around the scene and then try to get
the X and Y Length to set the SoOrthographicCamera height. The Values
I get from the calculated bounding box are always local to the
bounding box koordinate cross (sizeX,sizeY,sizeZ) ... so far so good.
If the bounding box edges are parallel to the global axis then all
works well. But if the bounding box is rotated in a special way then I
am unable to calculate the length for X and Y direction.
I have made some tests with the boundingbox->getTransform() but it
dosent worked.
I also tried to use boundingbox->getSpan() with the camera up and
right vector .... but this also dosent work if the bounding box is
rotated.
So, maybe you have another idea for my problem.
I just have to calculate the Camera Parameters so that the current
scene is shown best in the viewing window.
I hope you can help me ... I need a solution very soon!
Thanks a lot!!
Andy