Fixed a bug in SilhouetteGeomEngine::ImageToWorldParameter() that caused

instability issues regarding the view map creation.  A new iterative
solver of the 2D-to-3D inverse projection transformation problem was
implemented.  Instead of directly solving the problem in the direction
from the 2D to 3D space, the new solver starts with an initial guess of
an approximated solution and asymptotically approaches to the true
solution by iteratively performing the forward 3D-to-2D projection
transformation and improving the approximation.  Preliminary tests with
one simple and another complex scenes showed that the solver converges
quickly (more and less 20 iterations in many cases, with a stopping
criterion of a residual distance between the true and approximated
solutions less than 1e-6 Blender Unit).
This commit is contained in:
2010-01-10 14:08:59 +00:00
parent 05603fa110
commit 622a65a297
5 changed files with 77 additions and 9 deletions

View File

@@ -21,8 +21,20 @@ NodeGroup* BlenderFileLoader::Load()
cout << "\n=== Importing triangular meshes into Blender ===" << endl;
// creation of the scene root node
_Scene = new NodeGroup;
// creation of the scene root node
_Scene = new NodeGroup;
_viewplane_left= _re->viewplane.xmin;
_viewplane_right= _re->viewplane.xmax;
_viewplane_bottom= _re->viewplane.ymin;
_viewplane_top= _re->viewplane.ymax;
_z_near= _re->clipsta;
_z_far= _re->clipend;
#if 0
cout << "frustrum: l " << _viewplane_left << " r " << _viewplane_right
<< " b " << _viewplane_bottom << " t " << _viewplane_top
<< " n " << _z_near << " f " << _z_far << endl;
#endif
int id = 0;
for(obi= (ObjectInstanceRen *) _re->instancetable.first; obi; obi=obi->next) {
@@ -37,8 +49,8 @@ NodeGroup* BlenderFileLoader::Load()
cout << " Sorry, only vlak-based shapes are supported." << endl;
}
//Returns the built scene.
return _Scene;
//Returns the built scene.
return _Scene;
}
void BlenderFileLoader::insertShapeNode(ObjectRen *obr, int id)