#Finding if point is within surface-light like area

36 messages · Page 1 of 1 (latest)

sly fog
#

How can I find if a point is inside the red box? @me if you need more info (or better pictures lol)

sly fog
#

I shpuldve added this, however you are able to edit the angle pf the box in radians. The box isnt a literal object nor mesh

#

Think of a surface light, and detecting a point within the surface light.

coral juniper
#

pretty sure region3 is deprecated

coral juniper
coral juniper
#

all the workspace region3 methods are deprecated

#

it is replaced with workspace:GetPartsInPart() workspace:GetPartBoundsInBox() workspace:GetPartBoundsInSphere()

sly fog
#

Like the red/yellow box, you can change the angle of it

coral juniper
#

wait whst

#

that custom angle is just the perspective

sly fog
#

? Its like a surface light

coral juniper
#

hmm

#

so a point in a polygon?

sly fog
#

Somewhat, let me find a picture

coral juniper
coral juniper
#

check if point is in surface light region

sly fog
#

I shouldve sent that picture first, mb

coral juniper
#

ok

#

well the shape of the surface light is called as a frustum

#

so google "check if point in frustum"

#

and try to solve it yourself

sly fog
#

Oh i didnt know that, thank you

#

i was looking up random shapes oml

coral juniper
#

lol

#

i just remembered the word from view frustum

#

which is the camera's frustum

sly fog
#

ah like fov

coral juniper
#

ye

#

there is a thing called frustum culling also

#

which removes objects if their not in the view frustum

sly fog
#

Oh i think ive heard of that, like “unloads” anything not in view. performance thing