world_to_screen

function

world_to_screen(_position[, _screenWidth[, _screenHeight]])

Description

Computes screen-space position of a point in world-space.

Arguments

Name Type Description
_position BBMOD_Vec3 The world-space position.
_screenWidth Real/Undefined The width of the screen. If undefined, it is retrieved using window_get_width.
_screenHeight Real/Undefined The height of the screen. If undefined, it is retrieved using window_get_height.

Returns

BBMOD_Vec4/Undefined The screen-space position or undefined if the point is outside of the screen.

Note

This requires BBMOD_Camera.ViewProjectionMatrix, so you should use this after BBMOD_Camera.update_matrices (or BBMOD_Camera.update) is called!

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on May 18, 2022 using GMDoc.