Discuss Scratch

MentalBox
Scratcher
100+ posts

Cutting lines.

So I'm working on a doom engine and I need to make a bsp tree

(if you don't know what that is, Id suggest looking here)

I've got all the 3d under control but I cant seem to figure out how to slice the polygons for the tree.

Here is my algorithm for ploygons:
https://scratch.mit.edu/projects/581859434/

I just wanna know how to bisect a line another line that mathematically extends to infinity (In other words, I find the mathematical formula for one line, and use it to cut all lines that intersect.)

Last edited by MentalBox (Oct. 10, 2021 19:49:35)

MathPuppy314
Scratcher
500+ posts

Cutting lines.

It's a little hard to understand (probably because I didn't research bsp trees in detail) but it sounds like you just want to solve a system of linear equations, in which case, you can just search that online. I've made a somewhat simple line collision script here, so that might help.

MentalBox
Scratcher
100+ posts

Cutting lines.

This is perfect! Thank you!

Powered by DjangoBB