10. 3角形メッシュデータを用いた3次元空間における曲面表示



ソースプログラム(Fortran 90,自動倍精度利用)
!******************************** ! 3D Graphic Sample No. 5 * ! 3D Tringlar Mesh * !******************************** program gsample10 implicit none integer, parameter :: imax = 20, jmax = 20, npmax = (imax+1)*(jmax+1) real x(npmax),y(npmax),z(npmax) integer node(3,npmax*2),i,j,np,ns,np0 np = 0 do j = 0, jmax do i = 0, imax np = np + 1 x(np) = (i-imax/2)*0.9 z(np) = (j-jmax/2)*0.47 y(np) = 0.2*(z(np)**3-1.5*x(np)*z(np))*imax/(4*imax-3*i) enddo enddo ns = 0 np0 = 0 do j = 0, jmax-1 do i = 0, imax-1 ns = ns + 1 np0 = np0 + 1 node(1,ns) = np0 node(2,ns) = np0 + imax + 2 node(3,ns) = np0 + imax + 1 ns = ns + 1 node(1,ns) = np0 node(2,ns) = np0 + 1 node(3,ns) = np0 + imax + 2 enddo np0 = np0 + 1 enddo call fr_ginit call fr_opencanvas(1,'gsample10',101) call fr_project(5.0,1) call fr_margin3d(10,20,10,80) call fr_angle3d(30.0,10.0) call fr_aspect3d(1.0,1.0,1.0,0) call fr_xyzname('x-ax','y-ax','z-ax') call fr_trisurface(x,y,z,np,node,ns,-2,4) call fr_gend end program gsample10


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