xtitus
08-09-2014 11:16:52
I've found some type of bug...but not exactly sure what's going on. I'm extruding a circle along a 3D spline, and sometimes it okay, other times I think the indexes or something get messed up and the extrusion looks like it goes out to infinity. I've isolated one senario where this happens and made a test code to replicate. I've also attached images of this in point / wireframe / solid for reference. I'm using the library code at the latest in the repo. Any ideas on what the issue might be? Below is the test code for this instance. If you zoomed out, you'd see straight lines extending out to infinity to the right... The wireframe image illustrates the issue the best.
[attachment=1]issue_wireframe.jpg[/attachment]
[attachment=2]issue_solid.jpg[/attachment]
[attachment=0]issue_points.jpg[/attachment]
Procedural::CatmullRomSpline3 curve = Procedural::CatmullRomSpline3();
curve.setNumSeg(1);
std::vector<Ogre::Vector3> test;
test.push_back(Ogre::Vector3(-8.91404, 218.203, -14.5234));
test.push_back(Ogre::Vector3(-8.81021, 219.189, -11.6918));
test.push_back(Ogre::Vector3(-8.91404, 218.203, -14.5233));
test.push_back(Ogre::Vector3(-9.01786, 217.217, -17.3549));
test.push_back(Ogre::Vector3(-9.12169, 216.232, -20.1864));
test.push_back(Ogre::Vector3(-7.80048, 216.1, -22.8766));
test.push_back(Ogre::Vector3(-9.05608, 214.661, -25.1905));
for(int i=0; i<test.size(); i++)
curve.addPoint(test);
Procedural::Path p = curve.realizePath();
Procedural::Shape s = Procedural::CircleShape().setRadius(1).realizeShape();
Procedural::Extruder().setExtrusionPath(&p).setShapeToExtrude(&s).setCapped(false).realizeMesh("foo");
Ogre::Entity* blah = mSceneMgr->createEntity("foo");
mSceneMgr->getRootSceneNode()->attachObject(blah);
[attachment=1]issue_wireframe.jpg[/attachment]
[attachment=2]issue_solid.jpg[/attachment]
[attachment=0]issue_points.jpg[/attachment]