import java.awt.*;
import java.awt.image.*;


public class Point3D{
  
  private float coord[];
  protected int size = 4;
  private int color;

  ///////////////////////// CONSTRUCTORS ///////////////////
  
  /**
   *  This constructor, which takes no arguments,
   *  allows for future extension.
   */
  public Point3D() {
    coord = new float[size];
    loadOrigin();
  }
  
  /**
    initialize components
   */
  public Point3D( float x, float y, float z, float w) {
    coord = new float[size];
    coord[0]=x; coord[1]=y; coord[2]=z; coord[3]=w;
  }
  
  /**
    initialize components
   */
  public Point3D( float x, float y, float z, float w, int clr) {
    coord = new float[size];
    coord[0]=x; coord[1]=y; coord[2]=z; coord[3]=w;
    color = clr;
  }
  

  /**
    initialize components
   */
  public Point3D( float x, float y, float z) {
    coord = new float[size];
    coord[0]=x; coord[1]=y; coord[2]=z; coord[3]=1.0f;
  }
   
   /**
    initialize components
   */
  public Point3D( float x, float y, float z, int clr) {
    coord = new float[size];
    coord[0]=x; coord[1]=y; coord[2]=z; coord[3]=1.0f;
    color = clr;
  }
    
  ////////////////////////// METHODS //////////////////// 

  public final void loadOrigin( ) {
      for( int i=0; i< (size-1); i++){
	  coord[i] = 0.0f;
      }
      coord[size-1] = 1.0f;
      return;
  }
    
    public final float getCoord( int i) {
	return coord[i];
    }

    public final void setCoord( int i, float val) {
	coord[i] = val;
    }

    public final int getColor() {
	return color;
    }
 
} //POINT3D

