Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rmodels] Strange behavior when rendering flipped billboards using DrawBillboardPro #3197

Closed
4 tasks done
bohonghuang opened this issue Jul 25, 2023 · 1 comment
Closed
4 tasks done

Comments

@bohonghuang
Copy link
Contributor

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

Hello! I found that when using DrawBillboardPro to render, if the height/width of the source is negative, the width/height of the size also needs to be changed to negative, otherwise the billboard will not be rendered. This may be detrimental to the API's usability and consistency. For example, when using DrawBillboardPro to render RenderTexture and flipping it upside down, both the height of source and the width of size need to be changed to negative, which is inconsistent with the behavior of DrawTexturePro. I believe the expected behavior should be able to use the source and size parameters independently to control the flipping of the billboard without interfering with each other. Any help you can provide would be greatly appreciated!

Code Example

Simply change the source variable in the billboard example of raylib to:

Rectangle source = { 0.0f, (float)bill.height, (float)bill.width, (float)-bill.height };
@bohonghuang bohonghuang changed the title [rmodel] Strange behavior when rendering flipped billboards using DrawBillboardPro [rmodels] Strange behavior when rendering flipped billboards using DrawBillboardPro Jul 25, 2023
@raysan5
Copy link
Owner

raysan5 commented Jul 25, 2023

@bohonghuang It seems like a bug, feel free to send a PR to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants