79423966

Date: 2025-02-08 21:47:09
Score: 1
Natty:
Report link

You are correct. The second example is for 3D scenes, while the first example is for 2D scenes.

In both examples, gl_Position is the final vertex position on the screen, and aPosition is the vertex positions in the model's space.

In the first example, it's treating it like the camera is looking at your object without any perspective or rotation, so the points are just directly scaled to fit the screen.

In the second example, it accounts for any 3D rotation of the camera and the model, so the points are taken from the model space, scaled through the model/view transformation (uModelViewMatrix), and then adjusted for camera perspective transformation (uProjectionMatrix).

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Iulian Radu