PDA

View Full Version : how can i do a triangles file in C for read in ac3d


ray
12th September 2003, 01:44 PM
i have this problem:

my C-code comes output the next format in general to a file (ascci)

x1 y1 z1 x2 y2 z2 x3 y3 z3 r g b

every space is a tabulator \t & ovbiously is a triangle whit color r g b (0-255).

then i want to transform this file to an other such that Ac3d can read.

if you know the sintaxis of a triangle in ac3d please this is the solution.

thanks :wink:

Andy
12th September 2003, 07:18 PM
Hi Ray,

The format of triangle files is in the AC3D manual. if you can change your c code to output lines like this:

fprintf(f, "%g %g %g %g %g %g %g %g %g 0x%X\n",
p1->x, p1->y, p1->z,
p2->x, p2->y, p2->z,
p3->x, p3->y, p3->z,
rgb);

that will load into AC3D as a .tri file.

Andy