Drawing Visible 3d Line from Node

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

Drawing Visible 3d Line from Node

Postby mubashar » Thu Jan 26, 2012 6:35 pm

Hello i want to originate Visible 3d line from my node and want to calculate collisions on basis of distance from node to node using line .... is it possible i want to do something like this ..

please check out

http://www.youtube.com/watch?v=FKAULFV8tXw
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: Drawing Visible 3d Line from Node

Postby zerochen » Thu Jan 26, 2012 6:45 pm

you don't really ask if it is possible to draw simple lines or?

anyway maybe you have a look at this snippet
viewtopic.php?f=9&t=38544&hilit=shield+effect
zerochen
 
Posts: 200
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Drawing Visible 3d Line from Node

Postby mubashar » Thu Jan 26, 2012 7:09 pm

@zerochen thanks dude i hope it will give me some startup :)
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: Drawing Visible 3d Line from Node

Postby mubashar » Fri Jan 27, 2012 7:07 am

Tried This But Failed To Draw Line Whats Problem With This Code ?

cpp Code: Select all
        core::line3d<f32> ray;
                core::line3d<f32> ray1;
                ray.start = camera->getPosition();
                ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f;
                        video::SMaterial m;
   m.Lighting=false;
   m.Thickness = 1.0f;
   driver->setMaterial(m);
   driver->setTransform(video::ETS_WORLD, core::matrix4());            
                        driver->draw3DLine(ray.end,ray.start,video::SColor(0,255,255,255));
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: Drawing Visible 3d Line from Node

Postby zerochen » Fri Jan 27, 2012 8:11 am

1. the lines are full transparent
2. maybe the draw call is not between driver->beginScene(true, true, video::SColor(50,50,50,50)); & driver->endScene();?
zerochen
 
Posts: 200
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Drawing Visible 3d Line from Node

Postby smso » Fri Jan 27, 2012 9:08 am

Maybe the line of sight of the camera coincides with the "3d Line". Try offseting ray.end to see whether the line is visible.

Regards
smso
smso
 
Posts: 220
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Drawing Visible 3d Line from Node

Postby CuteAlien » Fri Jan 27, 2012 9:26 am

A point from camera-start to target is likely only visible as a single pixel in the center. Try moving it up/down/left/right a little and you should probably see a line.
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5398
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Drawing Visible 3d Line from Node

Postby mubashar » Fri Jan 27, 2012 9:36 am

@smso and @CuteAleien Yes that's the problem Finally can see it :) thanks for help
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 0 guests