ProjectMatrix for control
Posted: 04 Dec 2021, 10:36
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...
/////
};