Line 3D
A fine code snippet to create a line in 3D space
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.
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
- 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
Contributors to this page: jacmoe
,
spacegaier
and
Beauty
.
Page last modified on Sunday 31 of July, 2011 23:31:59 UTC by jacmoe
.
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.
Sidebar
Search box
Online users
33
online users

