3ds max 2 visual c ++


#1

hello !
i have one problem and i hope u will respond me, because it’s very urgent.
so, i have to import a cube made in 3ds max to bring it onto a project that i make in visual c. the person who gave me the object said to me that it is made with max, and he gave me that object in a .txt file. i do believe that the object it’s made usng the max script program language. i have attached here the file. please look at it and tell me if this was done with 3ds max and if it was done by using the max scripting program.
and, if i do a mesh in 3ds max in poly modelling, is it possible for max to automatically generate the code in a .txt file like the one above ? for a very complex object, not a simply sphere, let’s say a human head, how do i make the .txt file ?
i have to mention that in the file above, the numbers represent :
8 - the number of points
12 - the number of triangles
then the sets of coordinates of the vertices
and then the points wich form the triangles

thank u !

// well, the .txt file look like this : (i don’t know how to attach a file here)
8
12
-60.000 -60.000 60.000
60.000 -60.000 60.000
60.000 60.000 60.000
-60.000 60.000 60.000
-60.000 -60.000 -60.000
60.000 -60.000 -60.000
60.000 60.000 -60.000
-60.000 60.000 -60.000
1 2 3
1 3 4
1 5 6
1 6 2
2 6 7
2 7 3
3 7 8
3 8 4
4 8 5
4 5 1
5 8 7
5 7 6


#2

I don’t know what the first 2 lines are for, but the rest is quite easy to interpret and obviously enough a cube with side = 120units
it’s not maxscript for sure since no SDK appears anywhere, it’s just a very minimal ascii output of some geometry.

the first 8 lines are the coordinates (assume they are in the local space of the object) of the vertices.

since vertices alone are not enough to define geometry (they only provide a points cloud) then you have to list the triangles; a cube has 12 of those, and they are presented by a list of conneced vertices.

1 2 3 means the first triangle is made of the first 3 vertices, 1 3 4 means that the following triangle in the stripping process is made from vertices 1, 3 and 4… and so on.

quite primitive and fairly limited as ascii output goes though.


#3

ok, but if i have a very complex object, let’s say a full human body, it is very dificult to write that file by hand… is there a way to generate that ascii file ? can max do that ?
thx !


#4

didn’t you say that your friend gave you that ascii?

if that’s a max output then that’s enough for you to extrapolate a triangulated model from.


#5

The first two lines will be your number of vertices and number of faces, respectively, to allow you to allocate enough memory to store the mesh in advance.

I’ve never looked at the max api, or maxscript, but it should be trivial to write a script or plugin that will write out a mesh in the format you’ve described.


#6

sorry, I totally misunderstood the post and thought that was an actual max’ ascii output and you were asking how to sort it out…
nevermind my posts.


#7

Ooops yup I seem to have missed the point as well.

Anyways do a google for Max’s ASE/ASC ascii file format, or the 3ds file format, or go to www.flipcode.com and ask on the forums there


#8

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.