Code covered by the BSD License  

Highlights from
Model3d

3.27273

3.3 | 11 ratings Rate this file 89 Downloads (last 30 days) File Size: 320.91 KB File ID: #7940
image thumbnail

Model3d

by Steven Michael

 

28 Jun 2005 (Updated 19 Sep 2005)

MATLAB class for reading, viewing 3D dxf and 3ds files.

| Watch this File

File Information
Description

This is a MATLAB class that allows the user to read in Autocad (.dxf) and 3D Studio Max (.3ds) files.

The class can be plotted and functions are included for simple model manipulation (translation, rotation, magnification, superposition)

MATLAB release MATLAB 7.0.4 (R14SP2)
Other requirements the file includes compiled MEX functions for Linux and Windows. The source is included so that it can be compiled on other platforms. A version will be uploaded soon that works on MAC platform.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (22)
23 Sep 2005 Christian none

Sorry, the last entry was a mistake. But this one is what I meant!

26 Apr 2006 olivier PROT

Very Nice ! Have some problems with .3ds files but it works well with .dxf.

27 Sep 2006 Justin Barnes

Worked great for me on 3ds but had dxf trouble

19 Nov 2007 Nory chemii

My friend introduced me to MATLAB when i search software for make 3D graphics with 3 values of X, Y and Z. I hope i can use MATLAB

20 Dec 2007 Lijun Yan

  thank you for your share, but there is nothing in model3d.m

09 Mar 2008 Scott B.

Sorry but for me this code was unreliable for dxf files produced by any version of autocad. I like the fancy class wrapper but you might want to reconsider your claims for dxf files. I'll revisit this and upgrade my review if you can sort out the dxf problems.

28 Jul 2008 Paul Foxgrover

Very helpful. Works Great!
Thanks!

10 Jun 2009 Gayathri

The code produced a model3d object, but was not able to plot it as it gave an error saying that the alpha value must be within 0 and 1.
A sample 3ds file that worked for the author could have been better to evaluate the functioning of this code.
A better readme would have been nice.

06 Aug 2009 Jon Beich

Model.m file is only remarks... can't use anything else without the model

18 Oct 2009 Bhavik

I am beginner in MATLAB please tell me how to run this file..

19 Jan 2010 Nikhil K

Very nice. Worked right away with just two lines of code and a 3DS model. Is there existing/planned support for animation, i.e. frames?

21 Jan 2010 Paul Foxgrover

Upgraded to 2008b and it stopped working. Couldn't fix it myself. Please update and I will change my rating.

23 Mar 2010 Srimal Jayawardena

Hi

Thanks for the great model3d script .

However, it behaves strangely for certain 3ds files.

For example, the following maxda3 3ds model purchased from,

http://www.the3dstudio.com/product_details.aspx?id_product=14495

was rendered as shown in

http://srimal-techdiary.blogspot.com/2010/03/misaligned-3ds-model-rendered-with.html

(Note: the wheels and fenders are in the wrong place)

It renders correctly in 3D MAX.

Am I missing something?

Thanks in advance

Srimal.

23 Mar 2010 Srimal Jayawardena

This is the link to the screenshot.

http://2.bp.blogspot.com/_XThHJOc8NjU/S6hDEmyBtaI/AAAAAAAAFu4/v1tvbCMsj1M/s1600-h/maxda3_3ds.png

Thanks

Srimal

23 Jun 2010 Greg

This code uses old-style (pre-2008a, I believe) object-oriented programming. As far as I can tell, that makes it pretty much non-functional in any newer version of Matlab.

23 Jun 2010 John D'Errico

greg is wrong here. The old style OOP methods still work nicely in current matlab releases.

04 Oct 2010 Markus

It is working nicely. But I have problems to run the rotation by using qrot(m,pi/2,pi/2). Or even if I load the qrot3d function from the file exchange it didn't work out. Does anybody have experience with this functions or can give me a hint how to use. Thanks a lot.

26 Mar 2011 Jonatan Olofsson

Here is what I changed in the makefile to get the compilation working on Linux64; The first rows in the makefile now looks as follows:
TARGET = ../model3d.mexa64
TARGET2 = ../serialize.mexa64
SOURCES = dxf.cpp mexfunction.cpp model3d.cpp c3ds.cpp
MATDIR = /opt/matlab
#CXX = icpc
#CXXFLAGS = -gcc-version=320 -cxxlib-gcc=/usr/local/gcc-3.2.3 -O3 -xN -w1
#CXX = /usr/local/gcc-3.2.3/bin/g++
CXX = g++
CXXFLAGS = -O3 -Wall -fPIC
LIBDIR = -L$(MATDIR)/bin/glnxa64

Note that you probably should adjust the matlab path.

Also, "int dims[3];" should be changed to "mwSize dims[3];" to make it compile.

Best Regards,
Jonatan Olofsson

26 Mar 2011 Jonatan Olofsson

"Also, "int dims[3];" should be changed to "mwSize dims[3];" to make it compile."

- In the mexfunction.cpp, row 211, that is

22 Apr 2011 Grant Lohsen

I can't get this to run on windows. I get the error "??? Undefined function or method 'model3d' for input arguments of type 'char'". I noticed that this includes .mexglx files, and i believe this is linux files. Does anyone have the mexw64 files so I can run this? alternatively, is there a free compiler I can put on my system to compile this?

Matlab R2008b

29 Sep 2011 Jonas  
17 Nov 2011 Bruno

in Matlab r2011b I try to excecute the command but I receive this error:
"Error using class
The CLASS function must be called from a class constructor." I guess I have to recompile it... Isn't it? How can I do it? Thank you very much!

Please login to add a comment or rating.
Updates
19 Sep 2005

Fix errors in the 'qrot.m' function for quaternion model rotation

title the "slice" function correctly in the source code

Tag Activity for this File
Tag Applied By Date/Time
graphics import Steven Michael 22 Oct 2008 07:51:40
graphics export Steven Michael 22 Oct 2008 07:51:40
dxf Steven Michael 22 Oct 2008 07:51:40
3ds Steven Michael 22 Oct 2008 07:51:40
model Steven Michael 22 Oct 2008 07:51:40
3d Steven Michael 22 Oct 2008 07:51:41
studio Steven Michael 22 Oct 2008 07:51:41
autocad Steven Michael 22 Oct 2008 07:51:41
graphic Steven Michael 22 Oct 2008 07:51:41
3ds Jon Beich 06 Aug 2009 06:21:13
3d Bhavik 18 Oct 2009 03:48:17
3ds Bhavik 18 Oct 2009 03:48:25
graphic Bhavik 18 Oct 2009 03:48:27
graphics import Bhavik 18 Oct 2009 03:48:28
model Bhavik 18 Oct 2009 03:48:30
graphics import Tanpreet 14 Nov 2009 05:50:12
3d Tanpreet 14 Nov 2009 05:50:24
graphics import Ken 16 Jun 2010 13:53:33
3ds Lakshmikanth 24 Apr 2011 06:58:09
3d Pratap Bhanu Solanki 15 Jun 2011 13:23:02
3d Isuru kumarasiri 24 Jun 2011 12:17:48
3ds p fontaine 15 Aug 2011 05:09:21
3d Dima Comer 02 Nov 2011 09:44:12
autocad Dima Comer 02 Nov 2011 09:44:23

Contact us at files@mathworks.com