Here’s a schema of what I’m trying to achieve:
(can only upload 1 picture so I’ve put numbers to describe each steps)
1: Draw 2 planes or preferably 2 circles (should be the same I assume). Then put a cylinder in between and cut that cylinder exactly where it intersects with the circles.
As you can see above, if you do a cylinder that’s exactly as long as it needs to be, unless it’s perpendicular… You’ll have either a tiny gap (if cylinder is too short):
See number 2 on pic.
Or it’ll go beyond (cylinder is slightly too long):
See number 3 on pic.
What I’d like would be a “nice” cut:
See number 4 on pic.
I’m not sure how to achieve this and my first thought would be to have a longer cylinder and a custom vertex + fragment shader to which I’d provide the min x and max x and anything below/above those values would receive a transparent color.
But it feels wrong .
I’m fairly new to all this, thanks for any idea and the patience to help me out .
Ps: I don’t have any code right now, just sharing my idea to see if I’m going into the right direction. I’m not expecting anyone to do this for me and provide code, just share idea/give some guidance .