[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-3dldf] How to z-sort the polygons of a cuboid using with_focus

From: scientist47
Subject: [help-3dldf] How to z-sort the polygons of a cuboid using with_focus
Date: Tue, 13 Mar 2007 22:00:55 +0100

Hi guys! I just started using this cool program for my master's thesis
report. Need a little help:

I have managed to filldraw the cuboid and other solid shapes with

output save_picture with_projection parallel_x_z;

but when I use

output save_picture with_focus f;


output save_picture with_focus f with_surface_hiding mean_z_sort;

the surfaces are not sorted, or sorted incorrectly - I'm not sure which.

I use the snapshot version from 3DLDFsnp.tar.gz.


ldf file source follows:


verbatim_metapost "verbatimtex \magnification=\magstep3 etex";

picture axis_picture;
picture save_picture;

point axis_pt[];

focus f;
set f with_position (10, -5, 2)
       with_direction (0, 2, 0)
       with_distance 100;

pickup pencircle scaled (.5mm, .5mm);

axis_y_rt    := 1;
axis_z_top   := 1;
axis_x_front := 1;

axis_pt0 := (axis_y_rt, 0, 0);
axis_pt1 := (0, axis_z_top, 0);
axis_pt2 := (0, 0, -axis_x_front);

drawarrow origin -- axis_pt0 on_picture axis_picture;
drawarrow origin -- axis_pt1 on_picture axis_picture;
drawarrow origin -- axis_pt2 on_picture axis_picture;"y", axis_pt0) axis_picture;
label.rt("z", axis_pt1) axis_picture;
label.lft("x", axis_pt2) axis_picture;

pickup pencircle scaled (.1mm, .1mm);


%polyhedron c;
%c := unit_icosahedron scaled 0.6;
cuboid c;
c := unit_cuboid;

filldraw c with_draw_color blue with_fill_color green;
show c;

save_picture := current_picture;

clear current_picture;

output save_picture with_projection parallel_x_z;
output save_picture with_focus f with_surface_hiding mean_z_sort;
output axis_picture with_focus f;
endfig with_focus f;

verbatim_metapost "end";


reply via email to

[Prev in Thread] Current Thread [Next in Thread]