Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //above code draw pentagons and points of their lines intersections
- // get models
- bioessence_vector models = DataMgr()->getBioCard()->getModels();
- std::vector<std::vector<mathix::vector3>> intersections;
- // copy current model to MathEssence data structure
- int current_model = 0;
- MathEssence* M = WorldMgr()->createEssence<MathEssence>(
- "type:MathEssence,name:$unique_name,copy_essence:" + models[current_model]->getName());
- // prepare planes to intersect
- std::vector<contours::Plane> planes;
- vector3 A = nose;
- vector3 B = mouthR;
- vector3 C = vector3(0, 0, -1);
- planes.push_back(contours::Plane(A, B, C));
- // intersect model by planes
- // vector of edges included in 'intersections' for each plane
- contours::calculateIntersections(M->getName(), planes, intersections);
- for (auto it = 0; it != intersections.size(); it++)
- {
- for (auto jt = intersections[it].begin(); jt != intersections[it].end(); jt++)
- {
- string point_name = unique_name();
- string pointMeshName = unique_name();
- WorldMgr()->createEssence<GraphicsEssence>("type : GraphicsEssence, position : " + to_string(*jt) + ", name : " +
- point_name + ", entity : { mesh_name : " + pointMeshName + ", mesh_type : MT_SPHERE, radius: " +
- to_string(0.006124 ) + "}, custom_material_name : Yellow");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement