Skip to main content

History: Line 3D

Preview of version: 14

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).

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



Alias: Line3D

History

Information Version
Tue 15 of Apr, 2014 01:04 GMT-0000 cool_thomas Update code to be compliant with recent Ogre versions 15
Thu 30 of Aug, 2012 17:12 GMT-0000 uzik usage notes 14
Thu 30 of Aug, 2012 15:32 GMT-0000 uzik 13
Sun 31 of Jul, 2011 23:31 GMT-0000 jacmoe 12
Sun 30 of Jan, 2011 12:54 GMT-0000 Beauty 11
Wed 12 of Jan, 2011 19:54 GMT-0000 Beauty removed redundant link 10
Wed 15 of Sep, 2010 09:56 GMT-0000 Beauty added link to ((DynamicLineDrawing)) 9
Wed 11 of Aug, 2010 16:08 GMT-0000 Beauty added note to dispose() line 8
Wed 11 of Aug, 2010 16:04 GMT-0000 Beauty added dispose() to code snippet ..... I hope this is right - I have no good C++ knowledge, but in C# this dispose call works well 7
Thu 22 of Jul, 2010 14:14 GMT-0000 spacegaier 6
Sat 02 of Jan, 2010 03:07 GMT-0000 jacmoe 5
Wed 16 of Dec, 2009 16:35 GMT-0000 jacmoe 4
Wed 16 of Dec, 2009 16:34 GMT-0000 jacmoe 3
Wed 16 of Dec, 2009 14:44 GMT-0000 spacegaier 2
Tue 16 of Dec, 2008 09:59 GMT-0000 Beauty 1