mesh
[OpenCASCADE] STL(Mesh) to Polygon 2
[ 2010년에 작성된 글입니다. 지금은 다를 수 있습니다. ] 이전 코드에서는 단순히 삼각형 정보를 얻어서 Compound 형식의 Shape로 만드는 것이었다. 2021.03.13 - [OCC] - [OpenCASCADE] STL(Mesh) to Polygon [OpenCASCADE] STL(Mesh) to Polygon [ 2010년에 작성된 글입니다. 지금은 다를 수 있습니다. ] Mesh를 가지고는 OCC에서의 일반적인 알고리즘을 사용할 수 없을 듯 하여, Polygon 으로 변환을 하였다. 물론 Mesh의 삼각형 데이터를 무작정 po sondra.tistory.com 그러다 보니 여러모로 만들어진 Shape로 처리할 수 있는 것들이 없었다. 하다 못해 Plane과의 intersection cur..
[OGRE] ManualObject to Mesh
ManualObject를 생성한 후, 다시 사용하고 싶을 때, Mesh로 만들어 놓으면, 나중에 mesh만 호출하면 되니 편리한 것 같다. ManualObject mo = scenMgr.CreateManualObject("test"); ... MeshPtr temp_mesh = mo.ConvertToMesh("unit.mesh"); 동일한 형상을 재활용하기 위해서는 instance를 만드는게 제일 좋은데, 그렇게 동작하는지, 복사해서 생성하는지는 테스트가 필요할 것 같다.
[OGRE] Loading Meshes From Any Path
리소스 경로는 resource.cfg 파일에 정의되어 있어야 한다. 임의의 경로에 있는 mesh를 읽어들이는 코드는 다음과 같다. // "source" should contain the pathname to your mesh file Ogre::String source; /* An alternate (better) way of doing the following would be to use the FileStreamDataStream class, which avoids having to use the more esoteric "stat" struct and stdio APIs. For more, see http://www.ogre3d.org/docs/api/html/classOgre_1_1FileStre..