lfd(double x)
{
double c;
int i1;
if(x < 100){
tg_fd(x);
}
else{
c = x;
for(i1 = 0; i1 < x / 100; i1++){
tg_fd(100.0);
c = c - 100.0;
}
tg_fd(c);
}
}
lmr(double x)
{
double c;
int i1;
if(x < 100){
tg_mr(x);
}
else{
c = x;
for(i1 = 0; i1 < x / 100; i1++){
tg_mr(100.0);
c = c - 100.0;
}
tg_mr(c);
}
}
lbk(double x)
{
double c;
int i1;
if(x < 100){
tg_bk(x);
}
else{
c = x;
for(i1 = 0; i1 < x / 100; i1++){
tg_bk(100.0);
c = c - 100.0;
}
tg_bk(c);
}
}
lmu(double x)
{
double c;
int i1;
if(x < 100){
tg_mu(x);
}
else{
c = x;
for(i1 = 0; i1 < x / 100; i1++){
tg_mu(100.0);
c = c - 100.0;
}
tg_mu(c);
}
}
lml(double x)
{
double c;
int i1;
if(x < 100){
tg_ml(x);
}
else{
c = x;
for(i1 = 0; i1 < (int)(x / 100); i1++){
tg_ml(100.0);
c = c - 100.0;
}
tg_ml(c);
}
}
lmd(double x)
{
double c;
int i1;
if(x < 100){
tg_md(x);
}
else{
c = x;
for(i1 = 0; i1 < x / 100; i1++){
tg_md(100.0);
c = c - 100.0;
}
tg_md(c);
}
}
cube(double x, double y, double z)
{
tg_pd(); lfd(y); lmr(x); lbk(y); lmu(z); lfd(y); lml(x); lbk(y); lmd(z); lmr(x);
tg_pu(); tg_fd(y); tg_pd(); lmu(z); tg_pu(); tg_bk(y); tg_pd(); lml(x); tg_pu(); tg_fd(y); tg_pd(); lmd(z);
tg_pu(); tg_bk(y);
}
men(double y, double z)
{
tg_pd(); tg_fd(y);
tg_save();
tg_mu(z); tg_bk(y); tg_pu();
tg_restore();
}
kakuchu(double kakusu, double hen, double h)
{
double kakudo;
int i1;
kakudo = 360 / kakusu;
for(i1 = 0; i1 < kakusu; i1++){men(hen, h); tg_rt(kakudo);}
}
pole()
{
int i1;
for(i1 = 0; i1 < 7; i1++){kakuchu(6.0, 16.0, 530.0); tg_pu(); tg_mr(90.0);}
tg_lt(90.0);
for(i1 = 0; i1 < 15; i1++){kakuchu(6.0, 16.0, 530.0); tg_pu(); tg_mr(90.0);}
tg_lt(90.0);
}
parthenon()
{
int i1;
tg_md(1000.0);
tg_pu(); tg_ml(500.0); tg_bk(750.0);
tg_setpc(7);
/*foundation*/
cube(780.0, 1600.0, 30.0);
tg_pu(); tg_mr(50.0); tg_fd(100.0); tg_mu(30.0); tg_pd();
cube(680.0, 1400.0, 30.0);
tg_pu(); tg_mu(30.0); tg_mr(10.0); tg_fd(45.0);
/*pole*/
for(i1 = 0; i1 < 2; i1++){pole();}
tg_pu(); tg_bk(45.0); tg_ml(10.0); tg_mu(530.0); tg_pd();
cube(680.0, 1400.0, 100.0);
/*roof*/
tg_pu(); tg_mu(100.0); tg_mr(340.0); tg_up(90.0); tg_fd(150.0);
tg_rr(90.9); tg_dn(113.86594); tg_pd();
cube(1400.0, 475.0, 25.0);
tg_pu(); tg_up(227.73188); tg_md(25.0); tg_pd();
cube(1400.0, 475.0, 25.0);
}
main()
{
int i1;
tg_openwin(640, 640);
tg_init();
tg_draw();
tg_ht();
tg_pu(); tg_md(1200.0); /**/tg_mr(100.0);/**/ tg_fd(500.0); tg_dn(90.0); /*tg_rt(45.0);*/
parthenon();
tg_pu(); tg_home(); tg_dn(90.0); tg_md(275.0);
/* tg_seteye(1);*/
/* tg_tell(1);*/
tg_view();
tg_manual();
for(i1 = 0; i1 < 50 - 30; i1++){tg_bk(20.0); tg_refresh();}
for(i1 = 0; i1 < 315 + 45; i1++){tg_lt(0.5); tg_mr(2100.0 * sin(3.1415926535*2/360)); tg_lt(0.5); tg_refresh();}
for(i1 = 0; i1 < 50 + 5; i1++){tg_fd(40.0); tg_refresh();}
for(i1 = 0; i1 < 105; i1++){tg_rt(3.0); tg_refresh();}
for(i1 = 0; i1 < 15; i1++){tg_up(3.0); tg_refresh();}
for(i1 = 0; i1 < 15; i1++){tg_dn(3.0); tg_bk(10.0); tg_refresh();}
for(i1 = 0; i1 < 50 - 20; i1++){tg_bk(40.0); tg_refresh();}
for(i1 = 0; i1 < 45; i1++){tg_rt(0.5); tg_ml(1500.0 * sin(3.1415926535*2/360)); tg_rt(0.5); tg_refresh();}
for(i1 = 0; i1 < 20; i1++){tg_fd(50.0); tg_refresh();}
for(i1 = 0; i1 < 20; i1++){tg_fd(100.0); tg_refresh();}
tg_draw();
}
|