⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 axis_info.java

📁 一个java3D的动画程序
💻 JAVA
字号:
/*
 * Created on 2005-7-18
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package Axis_info;
import javax.vecmath.*;

/**
 * @author carso
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Axis_info {
		/*画曲线是需要定义StripCount[],并指定StripCount[0]的直,现在我们的做法其实不可取
		 * 以后在改进是需要通过setStripCount()来指定
		 * 
		 * */
	   private int StripCount[] = new int[1]; 
	   
	   /*=  Point3f[] positions= new Point3f[6]是为了定义物体的位置,同理,个数应该通过
	    * 函数确定,在改进时,需要Point3f[6]根据需要动态指定Point3f[]的个数
	    * 目前
	    * */
	   private Point3f[] positions= new Point3f[6];
	   
	  
	   private float vert[] = {  
	        -20.0f, 0.0f,10.0f, 
	       20f, 0.0f,10.0f, 
	       22.0f, 0.0f,8.0f, 
	       22.0f, 0.0f,-10.0f, 
	       -20.0f,0.0f,-10.0f, 
		   -20.0f, 0.0f,10.0f
	      }; 
	   private float vert1[] = {  
	        -22.0f, 0.0f,12.0f, 
	       22f, 0.0f,12.0f, 
	       25.0f, 0.0f,10.0f, 
	       25.0f, 0.0f,-12.0f, 
	       -22.0f,0.0f,-12.0f, 
		   -22.0f, 0.0f,12.0f
	      }; 
	  private float[] knot_InMoveInPath={0.0f,0.3f,0.4f,0.6f,0.8f,1f};
	  public float[] getKnot_InMoveInPath(){
	  		return this.knot_InMoveInPath;
	  }
	  private Quat4f[] Quat_InMoveInPath=new Quat4f[6];
	  public Quat4f[] getQuat_InMoveInPath(){
	  	quats[0]=new Quat4f(0.0f,0,0.0f,0.0f);
	  	quats[1]=new Quat4f(0.0f,1,0.0f,0.0f);
	  	quats[2]=new Quat4f(0.0f,2,0.0f,0.0f);
	  	quats[3]=new Quat4f(0.0f,3,0.0f,0.0f);
	  	quats[4]=new Quat4f(0.0f,4,0.0f,0.0f);
	  	quats[5]=new Quat4f(0.0f,5,0.0f,0.0f);
	  	
	  	return this.Quat_InMoveInPath;
	  	
	  }
	   /*
	    * 
	    * 
	    * sections,quats,knots:使用在View_follow()类中,表示轨迹划分的区间
	    * */
	   private int sections;
	   private Quat4f[] quats;
	   private float[] knots;
	   private Point3f[] positions_inViewFol;
	   
	   public void setSections(int section){
  	   this.sections=section;
  	   quats=new Quat4f[section+1];
  	   knots=new float[section+1];
  	   positions_inViewFol=new Point3f[section+1];
	   for(int i=0;i<=sections;i++)
		{
			positions_inViewFol[i]=new Point3f(
			/*现在暂时设置j=-50*/
			-52+i,
			3.0f,
			5.0f
			);
			System.out.println("print sections:"+sections);
			quats[i]=new Quat4f(0.0f,i,0.0f,0.0f);
			knots[i]=i*(1.0f/sections);
		}	
	   }
	
	   public int getSections(int section){
		 	return this.sections=section;
	   }
	   public Point3f[] getPositions_inViewFol(){
	   		return this.positions_inViewFol;
	   }

	   public Quat4f[] getQuats(){
	 	return this.quats;
	   }
	   public float[] getKnots(){
	 	return knots;
   }

	   /*定义sections,quats,knots结束
	    * 
	    * 
	    * */
	   public float[] getvert(){
	   		return vert;	
	    }
	   
	   public float[] getvert1(){
   		return vert1;	
	   }
	   public int[] getStripCount(){
	   return 	StripCount;
	   }
	   
	   public Point3f[] getPosition(){
	   	return positions;
	   }
	   

	   
	public Axis_info(){
		StripCount[0]=6;
		sections=90;
		//为positions副职
	    positions[0]= new Point3f(-21.0f, 0.0f,10.0f);
	    positions[1]= new Point3f( 21f, 0.0f,10.0f);
	    positions[2]= new Point3f(23.5f, 0.0f,9.0f);
	    positions[3]= new Point3f(23.5f, 0.0f,-11.0f);
	    positions[4]= new Point3f(-21.0f,0.0f,-11.0f);
	    positions[5]= positions[0];
	    
	    
	    

		System.out.println("This Class Axis_info.Axis_info store point infomation");
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -