Simply put, I’m trying to take a table of vectors, and then inset them uniformly; I drew some pictures below so you can get a generalized idea as to what I’m attempting to achieve.
I’m going to be honest, I have no idea where to start. I’ve considered potentially figuring out ways to locate the corners and then separating it in to squares, but I’m not entirely sure.
What do the red dots represent vs. the blue dots? What is the end goal of this algorithm? Besides insetting the vectors, obviously, like what is it going to do?
from my understanding, you’re trying to map local units on a part? IIRC, you can just take advantage of this function here: CFrame:PointToObjectSpace()
This function takes advantage of a local axis correlating to the part, so for instance, if the part was translated on a global axis to like a V3(43,2,100), we could assign / get a variable, and it’d basically offset from the space on the global axis and then based on the operation given in, would translate using that data thus being a sort of ‘local’ translation.
If you have anymore questions correlating to translations locally, maybe check this out…?
If I’m not understanding your question properly either, please elaborate in greater detail. Hope I helped!
The red dots are the original positions, where-as the blue dots are the positions after the conversion, the purple lines can be defined as, let’s say x, the distance.
The end goal is to take a set of vectors, and appropriately map out vectors correlating to the original set; in reality this will be used for a roofing system.
I’m trying my best to understand this, and I’m a bit confused. What I’ve taken from this is, that you’re trying to translate a part and anticipate sort of the next position, to sort of create a mapped out roof of sorts? like filling empty space(s)? I’m a bit confused, sorry.
I’m assuming he’s trying to make it to where if you click on a house with no roof, it’ll create a roof on top of it that has a “lifted inset” type of look.
Given the (basic example) roof layout, the green vectors would be determined and he’s trying to get an algorithm to give him the red part’s positions in this image based on the array of Vectors that I labeled with green parts. Then, he could connect them and draw a roof.
thank you for the explanation. As per how to calculate something like this, I would assume that maybe, the best way to start would be, to create nodes for each corner of the house (like in your image), and then maybe draw out triangles and… well, this is really confusing me as well! this seems to be really tricky, but I know this has something to do with Delaunay triangulation.
I also know there are sources out there for creating stuff like this, EgoMoose is a big help, especially for times like these.
If you’re trying to create a roof in the shape in the example you created, I know it’s more than just what I listed… A sort of example would most likely be along the lines of, per face, calculate distance between them, and then for the facing, just have them look at the midpoint with a few more things to account for, such as the position of the current face, and other things to take into account, I will refrain from elaborating more, as I’m a tiny bit stumped here too, and I don’t want to mis-spread information / give bad advice at all. But for simple triangular roofs, it’d most definitely be way easier to draw out.
IIRC, that’s not something you should be worried about; as that gets very, VERY complicated. When you start switching quadrants, the math becomes more complex, and you’re going to have to make if not more than one, multiple exceptions for this kind of thing you’re trying to achieve (at least I think). Even Bloxburg, (the most customizable / interactive building system on ROBLOX thus far) only takes in 90-degree rotations, as anything else would be very, very specific in terms of creating. Stick to the basics first, try to get it to work with only 90-degree walls, and once you figure that out, and if you’re confident, try moving it up to be customizable with all vertical degrees.