[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Java3Djp:00526] タートルグラフィック・ライブラリー(1/3)



------------------------------------
    メーリングリストはDNS
    
    http://www.dns-ml.co.jp

初心者でも簡単開設・運用が可能です!
------------------------------------

タートルグラフィック・ライブラリーがかなり出来たので投稿します。

ITurtle.java
======================================================
//  Turtle graphics library
//  ITurtle.java
//  copyright(c)1999 ENDO Yasuyuki

package org.javaopen.j3d;

import javax.media.j3d.*;
import javax.vecmath.*;

public interface ITurtle {
  // Logomotion と Turtle3D から
  public void penUp();
  public void penDown();
  public void home();

  //移動
  public void forward(double distance);
  public void moveUp(double distance);
  public void moveRight(double distance);

  //回転
  public void turnRight(double angle);
  public void rolleRight(double angle);
  public void up(double angle);

  // Java 3Dに依存のメソッド
  public void addViewTransform(TransformGroup viewTrans); // setEye
  public void removeViewTransform();

  //すべての頂点座標と色の配列をGeometryArrayにセットする
  public void copyIntoGeometryArray(GeometryArray geom);
  
  public int getVertexCount();
  public Point3d[] getVertices();
  public Color3f[] getColors();
}
======================================================

IPoint.java
======================================================
//  Turtle graphics library
//  IPoint.java
//  copyright(c)1999 ENDO Yasuyuki

package org.javaopen.j3d;

import javax.vecmath.Point3d;

public interface IPoint {
  public void setPoint(Point3d point);
  public Point3d getPoint();
}
======================================================

IColor.java
======================================================
//  Turtle graphics library
//  IColor.java
//  copyright(c)1999 ENDO Yasuyuki

package org.javaopen.j3d;

import javax.vecmath.Color3f;

public interface IColor {
  public void setColor(Color3f color);
  public Color3f getColor();
}
======================================================

IPointColor.java
======================================================
//  Turtle graphics library
//  IPointColor.java
//  copyright(c)1999 ENDO Yasuyuki

package org.javaopen.j3d;

public interface IPointColor extends IPoint, IColor {}
======================================================
-- 
えんどう やすゆき <yasuyuki@xxxxxxxxxx>
http://www.javaopen.org/jfriends/ (Java互助会ホームページ)