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
may be draw3DLine bug?
-
- Posts: 31
- Joined: Mon Sep 05, 2005 4:47 pm
- Contact:
Wouldn't that be a line going directly into the screen?
All you would see is a dot...
But im not sure
All you would see is a dot...
But im not sure
GMan
Black Ninja Games
Black Ninja Games
i modified engine source and solve the problem
i modified CD3D9Driver.cpp
reference above code
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));
}
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
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.