spheredev / neosphere

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.
http://www.spheredev.org/
Other
105 stars 15 forks source link

Add API for frustum-based projection #329

Open Eggbertx opened 6 months ago

Eggbertx commented 6 months ago

As it is now, we have orthogonal projection (via Transform#project2D) and frustum projection (via Transform#project3D), but it would be nice to have perspective projection as well. This can be done by using GLM, which also adds other transform and matrix related functions like lookAt (which can use 2D or 3D vertices). It's written in C++, but in my experience, it works reasonably well with plain C.

fatcerberus commented 6 months ago

Wait, there’s a difference? I always thought perspective and frustum were the same.

Eggbertx commented 5 months ago

Actually scratch that, project3D is technically perspective (using FOV, aspect, and near/far values), frustum projection would be using left, right, top, bottom, near, and far planes.