alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

Opening 3d files (.obj or .stl) and taking its 2d projection #29

Closed yyashs closed 7 years ago

yyashs commented 7 years ago

Hi Alec!

Great work. Can you help me know how to read a 3d file and take its 2d projections on orthogonal planes? Thanks in advance

alecjacobson commented 7 years ago

You can use:

[V,F] = load_mesh('path/to/mesh.obj');

to load an obj or stl file.

What do you want as output for your projections? Just the vertices lying on the plane? Or a image (i.e., pixel values)?

yyashs commented 7 years ago

The 2d images are to be registered with another set of images and the transformation thus obtained has to be applied on the 3d model.

alecjacobson commented 7 years ago

So are the 2d images a rendering of the 3D model with lighting?

yyashs commented 7 years ago

No. The original images are source images. The projections are to be taken from a template 3d model. It would help to estimate 3d model of source images by registering them with the projections of template 3d model.

alecjacobson commented 7 years ago

I don't quite understand. What are "source images"? (Maybe adding pictures would help)

yyashs commented 7 years ago

Lets say I have 2d images only of a source model (3d structure unknown) and I want to estimate 3d model of the same on basis of its 2d images. To get around, I use a template 3d model and take its orthogonal 2d projections. Now these projections are registered with source images to get the transformation which is then to be applied on the template 3d model to estimate the source 3d model.

alecjacobson commented 7 years ago

tsurf or trisurf will render a mesh using an orthographic projection by default. you can set the camera and rendering style using built in Matlab commands as well.