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

Canvas position and 3D render questions #14

Open
selimanac opened this issue Aug 1, 2024 · 2 comments
Open

Canvas position and 3D render questions #14

selimanac opened this issue Aug 1, 2024 · 2 comments

Comments

@selimanac
Copy link

selimanac commented Aug 1, 2024

These are not issues but I couldn't understand how to handle a few scenarios. Just need an help.

I'm trying to use this as a drawing some debug drawings on the screen. Since Defold can't draw expect for a line this might come very very handy. It works fine when we obey the rules. I would like to improve my use case, but I have a few problems which I don't know how to solve. Actually debug drawing shouldn't be a thing to spend on time for. Since it is for quick testing. If it is not going to work, I prefer to use dummy sprites.

  • Lets say I would like to use defold-orthographic and it is center is 0,0. But we have to position the buffer sprite from 0.0 as in the example, it should be centered to 512 x 1024. So there is no way to draw from, let say '-100x-100' to '-50x-50'. Values always has to be positive. How can I handle this situation?
  • I couldn't manage to use this canvas properly when using build-in camera for 3d. I have to move the camera far far away to see the rendered texture(like z: -120). I didn't investigate it much but I can share a repo case. I know this is not the use case of this lib but it would be super useful if we can draw stuff for debugging.
@AGulev
Copy link
Owner

AGulev commented Aug 14, 2024

It's an interesting question. I've never thought about this lib as a canvas for debug drawing. I expect it will require a lot of extra functionality

@britzl
Copy link
Collaborator

britzl commented Aug 14, 2024

  • Lets say I would like to use defold-orthographic and it is center is 0,0. But we have to position the buffer sprite from 0.0 as in the example, it should be centered to 512 x 1024. So there is no way to draw from, let say '-100x-100' to '-50x-50'. Values always has to be positive. How can I handle this situation?

If you convert from world to screen space coordinates using the camera view and project and have your canvas in screen space (bottom left being 0,0) then it shouldn't be a problem.

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

3 participants