Independent of distance to the camera, it is always visible with one pixel width (unless there is an object in between the line and the camera).
Note: Recent version of Ogre::Material does not have a dispose() method, so if you get a compile error simply remove the line:
Copy to clipboard
myManualObjectMaterial->dispose(); // dispose pointer, not the material
From the following code
Copy to clipboard
Ogre::ManualObject* myManualObject = mSceneMgr->createManualObject("manual1"); Ogre::SceneNode* myManualObjectNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("manual1_node"); // NOTE: The second parameter to the create method is the resource group the material will be added to. // If the group you name does not exist (in your resources.cfg file) the library will assert() and your program will crash Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("manual1Material","General"); myManualObjectMaterial->setReceiveShadows(false); myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true); myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(0,0,1,0); myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(0,0,1); myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(0,0,1); myManualObjectMaterial->dispose(); // dispose pointer, not the material myManualObject->begin("manual1Material", Ogre::RenderOperation::OT_LINE_LIST); myManualObject->position(3, 2, 1); myManualObject->position(4, 1, 0); // etc myManualObject->end(); myManualObjectNode->attachObject(myManualObject);
See also
- MOGRE Line 3D
- ManualObject
- ManualObject 2D
- Circle3D
- DynamicLineDrawing - Create a line by the class SimpleRenderable, which can be modified with better performance
- Ogre Line Chart
- Debug Drawing Utility Class
Alias: Line3D