Im testing and playing around with lines in 3d space and on screen, and i stumbled on a problem
red line (on first picture) is from draw3DLine
red line is 3D position from camera direction 3d location (camera look@ pos) to 3d object in space and that part is ok
green line is from draw2DLine
green line with screen coordinates starting point (10,1) end point (100,100)
so after i draw gui im draw that 2 lines
first draw3DLine and then draw2DLine
but when draw3DLine + draw2DLine green line with screen coordinates starting point (10,1) end point (100,100) behave similar like 3d space point in draw3DLine.
(first picture)
if i remove draw3DLine leaving only draw2DLine then draw2DLine starts to act like it should on screen coordinates and not as a point in 3D space, so green line is correctly displayed in upper left corner.
(second picture)
so draw3DLine + draw2DLine problem (look at first picture)
if draw2DLine only, no problem (second picture small green line in left upper corner on screen)
Any idea why this is happening?
Problems with draw2DLine and draw3DLine
Re: Problems with draw2DLine and draw3DLine
Please always post your real code with such problems, it's really hard to understand what's going on when someone translates c++ into english first. We read code faster :-)
Do you set the transformation correct before drawing your lines? You need a call like:
Do you set the transformation correct before drawing your lines? You need a call like:
Code: Select all
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Problems with draw2DLine and draw3DLine
did not know that i need to use it coz when using only draw2DLine it looked ok and did not need setTransform
adding setTransform did correct my lack of knowledge, tu for help CuteAlien
adding setTransform did correct my lack of knowledge, tu for help CuteAlien