ProjectMatrix for control
Hi,
How can I set the Project matrix for the control (like Canvas)?
Setting a common Project matrix for IView doesn't suit me.
Have an idea to implement a custom FrameworkElement but not sure if this solution will work:
How can I set the Project matrix for the control (like Canvas)?
Setting a common Project matrix for IView doesn't suit me.
Have an idea to implement a custom FrameworkElement but not sure if this solution will work:
Code: Select all
class Viewport3D : public Noesis::FrameworkElement
{
using Base = Noesis::FrameworkElement;
public:
void OnRender(Noesis::DrawingContext* drawingContext) override
{
PushProjMatrix(); //store current proj matrix for Iview
SetProjMatrix(mViewProjMatrix); //set proj matrix for control
Base::OnRender(drawingContext);
PopProjMatrix();
}
//////
// override some other methods...
/////
};
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: ProjectMatrix for control
If you want to position a control in 3D you can use the Transform3D property.
In code you can set that property directly in any UIElement:
Is that what you are looking for?
In code you can set that property directly in any UIElement:
Code: Select all
Ptr<CompositeTransform3D> transform = *new CompositeTransform3D();
transform->SetRotationX(30.0f);
element->SetTransform3D(transform);
Re: ProjectMatrix for control
Unfortunately no,
I am using multiple Viewports,
so for each Viewport it will be necessary to calculate and store copies WorldViewProjMatrix , instead of one
I am using multiple Viewports,
so for each Viewport it will be necessary to calculate and store copies WorldViewProjMatrix , instead of one
Re: ProjectMatrix for control
Views only support a single ProjectionMatrix (at the root). If you need more than one, I think you can use several views.
Re: ProjectMatrix for control
my 3d elements are interactive,
and the Main and 3d IView overlap
in this case, there will be problems with management display events
and the Main and 3d IView overlap
in this case, there will be problems with management display events
Re: ProjectMatrix for control
I don't think you need a projection matrix for that. As Sergio explained, Transform3D can be used to position UI element in 3D space.
Only one projection matrix can be used per view.
Only one projection matrix can be used per view.
Who is online
Users browsing this forum: Bing [Bot] and 59 guests