User avatar
Topic Author
Posts: 23
Joined: 16 Apr 2021, 17:42

3D UI interaction issues

22 Nov 2021, 14:08

I'm trying to implement 3D ui elements, which I want to click and drag around. Imagine "image placer" in 2D world.
What I've did is created a canvas with custom name, obtained it through:
application_text_tool = Noesis::Ptr<AppTextTool>{Noesis::DynamicCast<AppTextTool*>(noesis_3d_view->GetContent())};
auto content_text_tool = Noesis::DynamicCast<Noesis::FrameworkElement*>(application_text_tool->GetContent());
world_space_canvas = Noesis::Ptr(content_text_tool->FindName<Noesis::Canvas>("TextToolCanvas"));
noesis_3d_view->SetSize(static_cast<uint16_t>(p.win_width), static_cast<uint16_t>(p.win_height));
Later I render it:
    const auto viewport = Noesis::Matrix4::Viewport(window_w, window_h);
    const auto view = Noesis::Matrix4(glm::value_ptr(camera.get_view()));
    const auto proj = Noesis::Matrix4(glm::value_ptr(camera.get_proj()));
    Noesis::Matrix4 offset = Noesis::Transform3::Trans(0.0, static_cast<float>(-window_h), 0.0).ToMatrix4();

    const auto prod = offset * view * proj * viewport;

Element itself:
    <Canvas x:Name="TextToolCanvas">
       <Viewbox Stretch="Uniform" StretchDirection="Both">
            <Rectangle Opacity="0.8" Width="736" Height="951" Fill="Red">
                        <ei:MouseDragElementBehavior ConstrainToParentBounds="False" />

So result looks like this:

But if I insert rectangle into 2D ui, everything works perfect.
User avatar
Site Admin
Posts: 2569
Joined: 22 Dec 2011, 19:20

Re: 3D UI interaction issues

24 Nov 2021, 19:53

We are investigating this issue because it looks like a bug in our code.
We'll keep you informed.
User avatar
Topic Author
Posts: 23
Joined: 16 Apr 2021, 17:42

Re: 3D UI interaction issues

29 Nov 2021, 12:34

Hi! Any update on this? Or maybe I should create a ticket?
User avatar
Site Admin
Posts: 3456
Joined: 20 Jan 2012, 17:18

Re: 3D UI interaction issues

29 Nov 2021, 17:29

Yes, please, create a ticket about this. Thank you.

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests