- krupitskas
- Posts: 23
- Joined:
3D UI interaction issues
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:
Later I render it:
Element itself:
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
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:
Code: Select all
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));
Code: Select all
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);
Code: Select all
<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>
But if I insert rectangle into 2D ui, everything works perfect. http://www.giphy.com/gifs/JMkTe0Rms1CqDyoJi5
-
sfernandez
Site Admin
- Posts: 2995
- Joined:
Re: 3D UI interaction issues
We are investigating this issue because it looks like a bug in our code.
We'll keep you informed.
We'll keep you informed.
- krupitskas
- Posts: 23
- Joined:
Re: 3D UI interaction issues
Hi! Any update on this? Or maybe I should create a ticket?
Re: 3D UI interaction issues
Yes, please, create a ticket about this. Thank you.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 32 guests