- krupitskas
- Posts: 23
- Joined:
Interaction with 3D UI
Hey!
Im working on 3d text tool and recently struggled with rendering. Right now struggling with selection (clicking).
Basically Im rendering whole view with custom matrix
Now I need to understand when anyone select text and highlight it
I've tried this:
This is Noesis::TextBlock, which accept canvas. Works nice when no matrix provided.
When matrix is provided, then clicking region isn't change (nothing renders there, but click callback works).
Also I've thought that Render(matrix) doing immediate calculations, so I've tried
Also no luck.
Checked Oculus example (can't run it though). Didn't saw anything special, same Render(matrix).
So what am I doing wrong?
Thanks.
Im working on 3d text tool and recently struggled with rendering. Right now struggling with selection (clicking).
Basically Im rendering whole view with custom matrix
Code: Select all
_view_3d_text->GetRenderer()->Render(prod);
I've tried this:
Code: Select all
_temp_text_block->PreviewMouseLeftButtonDown() +=
[canvas_text_tool](Noesis::BaseComponent* , const Noesis::MouseButtonEventArgs& ) {
spdlog::info("clicked");
};
When matrix is provided, then clicking region isn't change (nothing renders there, but click callback works).
Also I've thought that Render(matrix) doing immediate calculations, so I've tried
Code: Select all
_view_3d_text->SetProjectionMatrix(prod);
Checked Oculus example (can't run it though). Didn't saw anything special, same Render(matrix).
So what am I doing wrong?
Thanks.
Re: Interaction with 3D UI
The projection matrix passed to SetProjectionMatrix is used internally for all hit-testing calculations. Please confirm all events sent to IView are in the (0,0) - (view_width, view_height) range.
Indeed, you need to use SetProjectionMatrix. The alternative of passing the matrix to Render() was created to allow changes at render time (for example for rendering each eye in VR). By the way, inputs from each hand in VR is something we don't have implemented yet, at least without using "hacks" like changing the projection matrix before sending events for each hand. We need a better solution for that, but I would say this is not your case.
Indeed, you need to use SetProjectionMatrix. The alternative of passing the matrix to Render() was created to allow changes at render time (for example for rendering each eye in VR). By the way, inputs from each hand in VR is something we don't have implemented yet, at least without using "hacks" like changing the projection matrix before sending events for each hand. We need a better solution for that, but I would say this is not your case.
- krupitskas
- Posts: 23
- Joined:
Re: Interaction with 3D UI
Yes, without this range text not even beign rendered for me.The projection matrix passed to SetProjectionMatrix is used internally for all hit-testing calculations. Please confirm all events sent to IView are in the (0,0) - (view_width, view_height) range.
Still no luck to be able to click on text with custom 3d matrix provided.
- krupitskas
- Posts: 23
- Joined:
Re: Interaction with 3D UI
For simplicity I've added just 3 small radiobuttons, which works fine if not SetProjectionMatrix called (rendered in 2d, clickes fine).
If I provide my matrix, then radibuttons start moves with camera, but not working anymore.
In fact, radiobuttons and text still beign clicked in 2d space.
Please note that I set my projection matrix every frame, because my view matrix changed. Should it be done only once or maybe callbacks reattached?
If I provide my matrix, then radibuttons start moves with camera, but not working anymore.
In fact, radiobuttons and text still beign clicked in 2d space.
Please note that I set my projection matrix every frame, because my view matrix changed. Should it be done only once or maybe callbacks reattached?
- krupitskas
- Posts: 23
- Joined:
Re: Interaction with 3D UI
I feel like SetProjectionMatrix of IView only affects rendering. Should I use another object to set matrix for the hit test?
btw we still using 0.3.0.
btw we still using 0.3.0.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Interaction with 3D UI
Could you please create a ticket in our bugtracker? If that is not working it means there is a bug we need to fix.
- krupitskas
- Posts: 23
- Joined:
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Interaction with 3D UI
Thanks for the report, we'll fix it as soon as possible.
- krupitskas
- Posts: 23
- Joined:
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 66 guests