How do I calculate 2 points to make a region3?

Try placing points in different corners.

If you mean moving the 2 part positions presented in the image above, I already tried that and for some reason it didn’t change anything.

Wow, never realized the bounds mattered on Region3 constructors. But seems that the first vector should be all lower bounds of the region, while the second is the higher bounds of the region.
Maybe this wrapper function might be useful, it takes in two vectors to construct a region only considering absolute size bounds.

-- Given two vector3 values, returns a region with no negative size constraints
local function absoluteRegion(point1, point2)	
	if not (typeof(point1)=='Vector3' and typeof(point2)=='Vector3') then
		warn('Args must be vector3 values')
	end
	
	local vector_components={'X','Y','Z'}
	local p1={}
	local p2={}
	
	for i, axis in ipairs(vector_components) do
		p1[i]=math.min(point1[axis],point2[axis])
		p2[i]=math.max(point1[axis],point2[axis])
	end
	
	return Region3.new(Vector3.new(unpack(p1)), Vector3.new(unpack(p2)))
end
1 Like

A Region3 is represented like a cube and the cube has about 8 corners. Your two positions/points can be in any of those 8 corners except for the same corner so you could just move around and etc. Ideally, they should be diagonal from each other and there is two different diagonal setups you can have from two oppositely sided points (one half of the cube and the other half as sides),

I’ll figure out something for you if it stays unsolved and I can get on Studio.

I figured out the problem I was positioning the 2 parts wrong. The reason it was a line before was because I simply needed to move the lower corner to the opposite z direction instead of how it was before. And I also had the region from top to bottom, before it was bottom to top, but someone told me that (since I didn’t know I needed to switch the Z Position) it needed to be top to bottom.

The fix was just simple I removed the negative switches, and changed the points from point2 to point1, to point1 to point2. Then I just moved the bottom corner part the opposite side of what it was before and I fixed the issue.

After reading @greatgavin 's post when he said bottom to top, then after remembering what @ArtFoundation told me about how I can switch the two coordinates it helped me learn what I needed to do.

1 Like