Klasa persp
Janusz Sobieraj - 28 LO

Rzut perspektywiczny - klasa persp

package liceum28; 
import java.awt.*; 
public class p_ 
{ 
  public static double d; 
  public static pkt3d k_3d=new pkt3d(0,0,0); 
  //-------------------------------------------------------
  public static void rzutowanie(double nd) 
  { 
   d=nd; 
  } 
  //-------------------------------------------------------
  public static pkt3d p3d(double a,double b,double c) 
  { 
   return(new pkt3d(a,b,c)); 
  } 
  //-------------------------------------------------------
  public static pkt2d rzut(pkt3d p) 
  { 
   return(new pkt2d(p.x*d/(d-p.y),p.z*d/(d-p.y))); 
  } 
  //-------------------------------------------------------
  public static void punkt(Graphics g,pkt3d p) 
  { 
    lo28.punkt(g,rzut(p)); 
  } 
  //-------------------------------------------------------
  public static void pisz(Graphics g,pkt3d p,String zd) 
  { 
   lo28.pisz(g,rzut(p),zd); 
  } 
  //-------------------------------------------------------
  public static void kropka(Graphics g,pkt3d p,Color kolor) 
  { 
   lo28.kropka(g,rzut(p),kolor); 
  } 
  //-------------------------------------------------------
  public static void linia(Graphics g,pkt3d p,pkt3d k) 
  { 
   lo28.linia(g,rzut(p),rzut(k)); 
   k_3d.war(k.x,k.y,k.z); 
  } 
  //-------------------------------------------------------
  public static void kursor(Graphics g,pkt3d p) 
  { 
   k_3d.war(p.x,p.y,p.z); 
  } 
  //-------------------------------------------------------
  public static void kreska(Graphics g,pkt3d k) 
  { 
   linia(g,k_3d,k); 
   _3d.war(k.x,k.y,k.z); 
  } 
}

Klasa zbudowana podobnie jak klasa _3d.