may be draw3DLine 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
populous
Posts: 3
Joined: Tue Oct 04, 2005 12:34 pm

may be draw3DLine bug?

Post by populous »

vector of line is affected by position of scene node

i want to draw from (0, 0, 0) to (0, 0, 100), but line is not there

i posted this problem in beginners help
BlackNinjaGames
Posts: 31
Joined: Mon Sep 05, 2005 4:47 pm
Contact:

Post by BlackNinjaGames »

Wouldn't that be a line going directly into the screen?

All you would see is a dot...

But im not sure :?
populous
Posts: 3
Joined: Tue Oct 04, 2005 12:34 pm

i modified engine source and solve the problem

Post by populous »

i modified CD3D9Driver.cpp

Code: Select all

//! Draws a 3d line.
void CD3D9Driver::draw3DLine(const core::vector3df& start,
	const core::vector3df& end, SColor color)
{
	core::matrix4 mat;
	mat.makeIdentity();
	setTransform(ETS_WORLD, mat);

	setVertexShader(EVT_STANDARD);
	setRenderStates3DMode();
	video::S3DVertex v[2];
	v[0].Color = color;
	v[1].Color = color;
	v[0].Pos = start;
	v[1].Pos = end;

	pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, v, sizeof(S3DVertex));
}
reference above code
gershon
Posts: 10
Joined: Tue Aug 30, 2005 7:50 pm
Location: Israel

Post by gershon »

you posted a bug,
now you cant draw the line in diffrent space.

i use
driver->setTransform(video::ETS_WORLD, core::matrix4());
to reset to the world matrix

but also
driver->setTransform(video::ETS_WORLD, node->getAbsoluteTransformation() );
driver->draw3DLine( vector3df(0,0,0), vector3df(0,0,10), RED );

now being in my node's own coordinate system i see a line pointing forward
Same same but diffrent.
omaremad_

Post by omaremad_ »

btw draw the line every frame after the scene has been rendered or it will be overwritten by the new frame's pixels

i had trouble with driverdraw image till i realised this
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

This is not a bug, it is intended to work like this. It's even written down in the documentation. But I'm going to clarify it a bit there.
Post Reply