How can I position (translate) a viz 3d object (wmesh) on a specific x,y screen coordinates?

asked 2017-03-12 07:52:17 -0600

Oguz gravatar image

updated 2017-03-12 07:53:25 -0600

The function may look like : GetTheTransformationVectors = (Input viz 3d object,input x,y, input hight,input width,output tvec,output rvec)

I have tried to use converto3dray,but I could not make it. There is no example about converto3dray on Google, may be I should use OpenGL instead of VIZ ?

Thank you very much.

edit retag flag offensive close merge delete

Comments

VIZ is a VTK wrapper which is an opengl wrapper.

LBerger gravatar imageLBerger ( 2017-03-12 11:33:09 -0600 )edit

Thanks a lot for the reply. Do you have any comment on the question ?

Oguz gravatar imageOguz ( 2017-03-12 12:23:39 -0600 )edit

I think you can use affine transform in showWidget

LBerger gravatar imageLBerger ( 2017-03-12 12:30:42 -0600 )edit

For instance I want to position 3d object on 150, 250 uv ,

Below code does not work that way ,I may be missing something :

viz::WMesh batman(viz::Mesh::load("C:/data/AE1400245-scaled.ply"));

Affine3d pose = Affine3d().translate(Vec3d(150, 250, 1.0));

myWindow.showWidget("img2", batman, pose);

Oguz gravatar imageOguz ( 2017-03-12 13:00:13 -0600 )edit

I think what you want it is example transformation. A camera is set and object is moved in front of camera

LBerger gravatar imageLBerger ( 2017-03-12 15:14:42 -0600 )edit