9. 2次元配列を用いた3次元空間における曲面表示



ソースプログラム(Fortran 90,自動倍精度利用)
!******************************** ! 3D Graphic Sample No. 4 * ! Double Torus * !******************************** program gsample9 implicit none integer, parameter :: imax = 51, jmax=51 real, parameter :: pi = 3.141592653589793 real x(imax,jmax),y(imax,jmax),z(imax,jmax) real u,v,du,dv integer i,j du = 2*pi/(imax-1) dv = 2*pi/(jmax-1) call fr_ginit call fr_opencanvas(1,'gsample9',101) call fr_margin3d(50,30,50,80) call fr_angle3d(30.0,-60.0) call fr_aspect3d(1.0,1.0,1.0,0) call fr_xyzname('x-ax','y-ax','z-ax') call fr_frame3d(-1.3,2.3,-1.3,1.3,-0.5,0.5,3) do j = 1, jmax v = dv*j do i = 1, imax u = du*(i-1) x(i,j) = (1+0.25*cos(v))*cos(u) y(i,j) = (1+0.25*cos(v))*sin(u) z(i,j) = 0.25*sin(v) enddo enddo call fr_surface(x,y,z,imax,jmax,3,-1) do j = 1, jmax v = dv*j do i = 1, imax u = du*(i-1) z(i,j) = (1+0.25*cos(v))*cos(u) x(i,j) = 1+(1+0.25*cos(v))*sin(u) y(i,j) = 0.25*sin(v) enddo enddo call fr_surface(x,y,z,imax,jmax,4,3) call fr_gend end program gsample9


Copyright (C) Toshihiro Taguchi, Setsunan University, 2000-2013 All rights reserved.