Skip to content

Clarification for makePerspective docs #17

@parasyte

Description

@parasyte

https://github.com/greggman/webgl-fundamentals/blob/master/docs/module-webgl-3d-math.html#L1768-L1770

Note that near and far are not z coordinates, but rather they are distances along the negative z-axis.

IMHO, this could be more specific; If near and far are not coordinates, what are they?

I'm trying to understand the relationship of the frustum to clip space. From experimental testing, I can see that near fragments are always clipped somewhere between Z -1 and -2, regardless of how I set near in makePerspective, and I have been unable to find the far clipping plane, as even incredibly distant objects (Z -1e12) are still drawn (can be seen better when scaled appropriately).

I'm really just trying to get an understanding for how much play room I have within my 3D space. It seems like pretty much every number less than -2 will render.

In more concrete terms, when I use:

makePerspective(Math.PI / 2, width / height, 10, 50);

What is the expected valid range for the Z axis, before it exits clips space?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions