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

Better event capture for uiCircleCaptureExample.jl #27

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

ut112002
Copy link
Member

@ut112002 ut112002 commented Mar 7, 2024

@VarLad and I found a better way to tackle the example

please take a look.

@arhik
Copy link
Member

arhik commented Mar 7, 2024

Yes. Snappier than earlier version.

examples/uiCircleCaptureExample.jl Show resolved Hide resolved
@arhik arhik merged commit e751a2e into JuliaWGPU:main Mar 7, 2024
3 checks passed
@ut112002
Copy link
Member Author

ut112002 commented Mar 8, 2024

@arhik now we are trying to make the circle move , unfortunately changing the vertex data does not move it.

what would be the best way to move the circle without creating new objects.

@arhik
Copy link
Member

arhik commented Mar 8, 2024

object.uniformData = translate([sin(time()), 0.4, 0.0]).linear in your example works. you might have to switch to PollEvents.

@arhik
Copy link
Member

arhik commented Mar 8, 2024

Also in case you want to track mouse. Our window size is hardcoded to (500, 500). You will have to do this. with y and x flipped and negated.

(y, x) = 2.0.*(mouseState.prevPosition./500.0 .- 0.5)
object = mouseState.leftClick ? renderer.scene.objects[2] : renderer.scene.objects[1]
object.uniformData = translate([x, -y, 0.0]).linear

@arhik arhik linked an issue Mar 11, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Feature request: Better fetching of events
2 participants