Home / Forums / Handling Near-Plane Camera Clipping in 3D Bounding Box Projection (Part 3)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

Handling Near-Plane Camera Clipping in 3D Bounding Box Projection (Part 3)

GhostHunter_x
Unity & Phasmo Modder
VIP
Rep: 275
Join Date: Apr 2023
Posts: 17
Thanks: 71
3y ago · Jun 7, 2023 5:55 PM
#1
When an entity is partially behind or intersecting the camera near clipping plane, raw WorldToScreen math can produce inverted projection artifacts.
GhostHunter_x · Phasmophobia & Unity Reverser
GhostAI, Sanity, EMF & Evidence inspection
The following users thanked GhostHunter_x for this post:
KeycardMaster
Item ESP & Unity UI Dev
MEMBER
Rep: 215
Join Date: Oct 2023
Posts: 19
Thanks: 54
3y ago · Jun 7, 2023 10:31 PM
#2
Checking clipW < 0.01f or performing homogeneous polygon clipping against the near plane (w > nearPlane) prevents screen-stretching glitches.
KeycardMaster | Keycard & Objective ESP Specialist
KronoDev
C++ / Game Modder
MEMBER
Rep: 195
Join Date: Jan 2023
Posts: 32
Thanks: 48
3y ago · Jun 9, 2023 1:31 AM
#3
Adding a simple frustum boundary check before rendering the box vertices keeps the overlay completely artifact-free.
KronoDev - Keep coding, keep learning