这是一篇2005年的siggraph 论文, As-Rigid-As-Possible Shape Manipulation。
源代码在这里:http://www.dgp.toronto.edu/~rms/software/Deform2D/。
但下载后, 有几个错误导致不能编译。 需要修改一下。
首先是stdafx.h 文件, 这里需要把0x0400和0x0410替换为0x0501, 这是windwos版本的代号。
其次是RigidMeshDeformer2D.cpp第135行, 我也不太明白为什么在这里等于号报错, 所以只能采用曲线救国的方法了, 就是先earase这个东西, 然后重新添加了。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16void RigidMeshDeformer2D::UpdateConstraint( Constraint & cons ) { std::set<Constraint>::iterator found( m_vConstraints.find(cons) ); if ( found != m_vConstraints.end() ) { // (*found).vConstrainedPos = cons.vConstrainedPos; // m_vDeformedVerts[cons.nVertex].vPosition = cons.vConstrainedPos; m_vConstraints.erase(found); m_vConstraints.insert( cons ); m_vDeformedVerts[cons.nVertex].vPosition = cons.vConstrainedPos; InvalidateSetup(); } else { m_vConstraints.insert( cons ); m_vDeformedVerts[cons.nVertex].vPosition = cons.vConstrainedPos; InvalidateSetup(); } }
最后, 是Deform2d.cpp, 删除掉&就好。
还有就是直接编译, debug报错, 具体参见我的前一篇文章就可。
这样就能编译成功并运行了。一下是效果。
enjoy it。
最后
以上就是爱笑手套最近收集整理的关于as rigid as possible编译的全部内容,更多相关as内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复