raylib»Forums
2 posts
Change bounds.position and size
Edited by ClemClem on Reason: Initial post
Hello,

See this example : Raylib Examble

I change the position of the model => Vector3 position = { 0.0f, 0.0f, 0.0f }; to Vector3 position = { 0.0f, 50.0f, 0.0f };
I change the size of the model => DrawModel(model, position, 1.0f, WHITE); to DrawModel(model, position, 0.3f, WHITE);

Bounds are calculated from the original size of the model.
How can I change the position and the size of bounds to adapt the new position and the new size of the model ?

Thanks :)

Clem
4 posts
Change bounds.position and size
There's actually a hint in the code! It says that the bounds are calculated from the original size of the model,
if model is scaled on drawing, bounds must be also scaled.

That's just a matter of scaling the bounds like this:

1
2
3
float Scale = 0.3f;
bounds.min = Vector3Scale(bounds.min, Scale);
bounds.max = Vector3Scale(bounds.max, Scale);

2 posts
Change bounds.position and size
Hello,

thank you for this answer Tjom2000 :)
Ray
62 posts / 1 project
I like videogames/gametools development.
Change bounds.position and size
Yeap, that's the answer, bounds should be manually recalculated by the user.