Archive 17/01/2023.

Billboards of constant size

GIMB4L

How would I go about making a billboard sprite that is unaffected by distance from the camera?

friesencr

Like a sprite in 2d screen space?

GIMB4L

Essentially. If there’s an easy Vector3::ToScreenSpace function that would work out fine.

friesencr

We just a had a discussion about that not to long ago.

topic102.html

Here is the code he used.

// This line should set the cube in the very top-left corner of the screen. Or not?
    Vector3 playerPos = camera->ScreenToWorldPoint(Vector3(0, 0, 20));
    cubeNode_->SetPosition(playerPos);

The gotcha was aspect ratio in his situation.