create a 3d view in a MFC dialog

Jonathan

CAD community veteran
Hi,

I am trying to add a 3d viewer so can I display some selected model in a dialog, but I can't figure out what I am doing wrong..

I recreated a new display connection, graphic driver, viewer, context..

I created a new NT window, but how do I display that in the Dialog?

the code runs ok but it does not create the view.

I did look at the inspector because what I want to do is similar to the view at the bottom right, but it's in qt and I understand that even less.

I am not sure what kind of control I can use in the dialog that I can render the viewer in..

I tried to use a CStatic, it didnt work, I tried a custom control.. I couldn't get it to work.
any one has an idea?
 

JSlyadne

Administrator
Staff member
Hi Jonathan!

Open Cascade provides the sample application based on MFC. If I were you, I would start with trying to run this sample and then eliminate the redundant things by commenting them out piece by piece and checking that things are still on track.

@Quaoar posted the video on how to compile Open Cascade's MFC sample here
.
 

Jonathan

CAD community veteran
JSLyadne,

I think I found something similar in the HLR demo.

I'll investigate this, and let you know if I manage to make it work xD

Well the HLR demo help me to crate the viewport, it's quite a bit more laggy than the main view but oh well that will work good for what I am trying to do.

I was missing the GetDlgITem(item)->GetSafeHwnd();

their code do mention that wrapping the redraw code with ->SetRedraw(True) and SetRedraw(False) slow it down but without it there is no dynamic panning,zooming,etc happening..
 
Last edited:
Top