[no bug] drawLine3D bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
}{ermanssoN
Posts: 37
Joined: Mon May 26, 2008 7:39 pm

[no bug] drawLine3D bug

Post by }{ermanssoN »

Code: Select all

void
Application::Render( void )
{
	m_pVideoDriver->beginScene(true,true, SColor(127,127,127,255) );
	
		RenderWindowCaption();
		m_pSceneManager->drawAll();
		m_pGUIEnviroment->drawAll();
		m_pChatManager->Render();
		m_pVideoDriver->draw3DLine( vector3df(0,-30,-500), vector3df(0,-30,500) );
	
	m_pVideoDriver->endScene();
}
I use Irrlicht v 1.41

Instead of going from start to end point the line follows the camera. so when I look left the line follows;
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: drawLine3D bugg

Post by Acki »

no, not a bug, you simply don't set the tranformation matrix (so it uses the one from the last object, in this case the camera)... ;)

Code: Select all

void Application::Render( void ){
	m_pVideoDriver->beginScene(true,true, SColor(127,127,127,255) );
	
		RenderWindowCaption();
		m_pSceneManager->drawAll();
		m_pGUIEnviroment->drawAll();
		m_pChatManager->Render();

		matrix4 tmat; 
		pVideoDriver->setTransform(ETS_WORLD, tmat);
		m_pVideoDriver->draw3DLine( vector3df(0,-30,-500), vector3df(0,-30,500) );
	
	m_pVideoDriver->endScene();
}
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
}{ermanssoN
Posts: 37
Joined: Mon May 26, 2008 7:39 pm

Post by }{ermanssoN »

ahhh, itäs d3d style
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

All drawing methods require you to set up a proper transformation matrix etc. This is also mentioned in the API docs. You can create a custom scene node to get rid of this, 3d lines can also be drawn in there, the matrices are set up automatically.
Post Reply