Welcome to the new Ogre Wiki!
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
Line 3D
A fine code snippet to create a line in 3D space
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).
ManualObject* myManualObject = mSceneMgr->createManualObject("manual1"); SceneNode* myManualObjectNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("manual1_node"); MaterialPtr myManualObjectMaterial = MaterialManager::getSingleton().create("manual1Material","debugger"); 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
Contributors to this page: Beauty
,
spacegaier
and
jacmoe
.
Page last modified on Wednesday 11 of August, 2010 16:08:14 GMT by Beauty
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.

