Archived

This topic is now archived and is closed to further replies.

3D Line

This topic is 5249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is NOT a double post This is about a 3D line, the other about a 2D line I''m making a software 3D engine, I started with points and that works nice (expecially flying through a cube made of 100000 points is cool!), now I''m doing lines and that''s working fine except for one thing: If one endpoint of the line is in front of the camera and the other one is behind it, something goes wrong with the projection, and the line gets the wrong direction. What can I do about this, or in other words how do I have to project this endpoint onto the screen if it''s behind the camera? Thanks a lot.

Share this post


Link to post
Share on other sites
I''ve never done that before, but I assume you have to calculate the intersection of the line with your near plane and use that point instead of the point behind of the camera

Share this post


Link to post
Share on other sites
This is fun

Go look for homogeneous clipping on google. That way, you can clip to all frustum planes and thus skip line clipping.

Share this post


Link to post
Share on other sites