This commit is contained in:
Antoine Drouin
2010-02-22 11:58:10 +00:00
parent d6100f01d2
commit b46d62c4c1
4 changed files with 113 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
clean:
rm -f *~ foo*.png test.avi q3d.pov
+78
View File
@@ -0,0 +1,78 @@
//POVRay include files
#include "arrays.inc"
#include "chars.inc"
#include "colors.inc"
#include "finish.inc"
#include "glass.inc"
#include "golds.inc"
#include "math.inc"
#include "metals.inc"
#include "rand.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "shapesq.inc"
#include "skies.inc"
#include "stoneold.inc"
#include "stones.inc"
#include "stones1.inc"
#include "stones2.inc"
#include "strings.inc"
#include "textures.inc"
#include "transforms.inc"
#macro Q3D()
union {
box{<-250,-10,-10><250,10,10> texture{pigment{Red}}}
cylinder{<-250,10,0><-250,15,0> 125 texture{pigment{Green}}}
cylinder{<250,10,0><250,15,0> 125 texture{pigment{Green}}}
box{<-10,-10,-250><10,10,250> texture{pigment{Red}}}
cylinder{<0,10,-250><0,15,-250> 125 texture{pigment{Green}}}
cylinder{<0,10, 250><0,15, 250> 125 texture{pigment{Green}}}
}
#end
#declare cam_x = 0;
#declare cam_y = 5000;
#declare cam_z = 20000;
#declare cam_look_x = 0;
#declare cam_look_y = 0;
#declare cam_look_z = 0;
//#declare cam_a = 32;
#declare cam_a = 10;
camera
{
location <cam_x,cam_y,cam_z>
look_at <cam_look_x,cam_look_y,cam_look_z>
angle cam_a
}
#local lgt1_pos_x = 340;
#local lgt1_pos_y = 510;
#local lgt1_pos_z = 260;
#local lgt1_intense = 0.763488;
#local lgt2_pos_x = -340;
#local lgt2_pos_y = 510;
#local lgt2_pos_z = 260;
#local lgt2_intense = 0.763488;
#local lgt3_pos_x = 340;
#local lgt3_pos_y = 510;
#local lgt3_pos_z = -170;
#local lgt3_intense = 0.763488;
#local lgt4_pos_x = -340;
#local lgt4_pos_y = 510;
#local lgt4_pos_z = -170;
#local lgt4_intense = 0.763488;
light_source{<lgt1_pos_x,lgt1_pos_y,lgt1_pos_z> White*lgt1_intense}
light_source{<lgt2_pos_x,lgt2_pos_y,lgt2_pos_z> White*lgt2_intense}
light_source{<lgt3_pos_x,lgt3_pos_y,lgt3_pos_z> White*lgt3_intense}
light_source{<lgt4_pos_x,lgt4_pos_y,lgt4_pos_z> White*lgt4_intense}
background{Gray50}
+31
View File
@@ -0,0 +1,31 @@
function povray_draw( time, diff_flat_ref )
dt_display = 1/25;
t_idx = 1;
f_idx = 1;
t = time(t_idx);
while (t_idx<length(time))
printf('drawing %d (%f)\n', f_idx, time(t_idx));
x = -1000*diff_flat_ref(FDM_SX,t_idx);
y = 1000*diff_flat_ref(FDM_SZ,t_idx);
alpha = deg_of_rad(-diff_flat_ref(FDM_STHETA,t_idx));
// printf('( %f %f %f)\n', x, y, alpha);
fid = mopen('povray/q3d.pov', "w");
mfprintf(fid, "#include ""povray/q3d.inc""\n");
mfprintf(fid, "object { Q3D() rotate z*%f translate <%f,%f,0>}",alpha,x,y);
mclose(fid);
cmd = sprintf('povray povray/q3d.pov +Opovray/foo%04d.png Display=false +W800 +H600 +Q9 +A0.3 +R5', f_idx);
a = unix_g(cmd);
while (t_idx<length(time) & time(t_idx) < f_idx*dt_display)
t_idx = t_idx + 1;
end
f_idx = f_idx + 1;
end
mplayer_cmd = "mencoder ""mf://povray/foo*.png"" -mf fps=25 -o povray/test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800";
unix_g(mplayer_cmd);
endfunction
+2 -2
View File
@@ -23,7 +23,7 @@ if (0)
[fo_traj] = poly_gen_traj(time, coefs);
else
// differential equation
[fo_traj] = sbb_gen_traj(time, 5, rad_of_deg(29.983325), [0 0], [5 0]);
[fo_traj] = sbb_gen_traj(time, 5, rad_of_deg(29.983325), [-1 0], [1 0]);
printf('xfinal:%f\n',fo_traj(1,1,$));
end
@@ -45,7 +45,7 @@ for i=2:length(time)
end
//povray_draw(time, diff_flat_ref);
povray_draw(time, diff_flat_ref);
set("current_figure",0);
clf();