PDA

View Full Version : Finding intersection points for half hidden objects



Vskrap
03-10-2013, 02:40 PM
Hi,

I have tried searching the web to no avail, maybe someone here can point me in the right direction.

I am trying to render a simple scene to look as if hand drawn (sketch, I.e. mesh with some lines to long to short, not perfectly straight etc.) . The flow is:
1 Given the geometry and camera find all points that would produce lines in current view (I.e for a for a triangle partly obscured behind another all vertices for one of them, some on the intersection etc)
2 generate lines between the now calculated vertices positions as series of rectangles, mapping textures onto them.

So my question is, is this a reasonable setup, and if so how do I find the intersection points?

Regards

cireneikual
03-10-2013, 06:54 PM
Don't find intersection points. Just make the textures for the models have hand-drawn lines on them. Then, to get the outline around the entire model, you can render the model again but with no textures, front face culling, and completely opaque, while making the model "puff out" a bit by sliding vertex positions along the vertex normals in a vertex shader. Check out this link: http://unitygems.com/noobs-guide-shaders-6-toon-shader/

Vskrap
03-11-2013, 11:21 AM
Thanks for your reply.
However, just mapping textures was my first attempt. The problem is that hand drawn lines typically look different in the ends (quite straight in the middle and deviations and thicker in the ends). Using this approach I could not get the line end look where a line is partly hidden, that's whyI thought of finding the intersection and generating a new line.
Do I gather from your answer that this is impossible?