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
106 stars 15 forks source link

Add API for frustum-based projection #329

Open Eggbertx opened 10 months ago

Eggbertx commented 10 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 10 months ago

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

Eggbertx commented 9 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.