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

3D UI interaction issues

22 Nov 2021, 14:08

Hello!
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;

    noesis_3d_view->SetProjectionMatrix(prod);
    noesis_3d_view->GetRenderer()->RenderOffscreen(prod);
    noesis_3d_view->GetRenderer()->Render(prod);
Element itself:
    <Canvas x:Name="TextToolCanvas">
       <Viewbox Stretch="Uniform" StretchDirection="Both">
            <Rectangle Opacity="0.8" Width="736" Height="951" Fill="Red">
                    <i:Interaction.Behaviors>
                        <ei:MouseDragElementBehavior ConstrainToParentBounds="False" />
                    </i:Interaction.Behaviors>
            </Rectangle>
        </Viewbox>

    </Canvas>
So result looks like this: http://www.giphy.com/gifs/HyE5flQi9qF40jmQ3t

But if I insert rectangle into 2D ui, everything works perfect. http://www.giphy.com/gifs/JMkTe0Rms1CqDyoJi5

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 2389
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
krupitskas
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
jsantos
Site Admin
Posts: 3258
Joined: 20 Jan 2012, 17:18
Contact:

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: No registered users and 4 guests