Line 3D         A fine code snippet to create a line in 3D space
Print

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: jacmoe111451 points  , spacegaier3733 points  and Beauty5965 points  .
Page last modified on Sunday 31 of July, 2011 23:31:59 GMT by jacmoe111451 points .


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.