精通Micro3D v3基础技术[6]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

private Vector3D dir = new Vector3D(-3511, 731, 878); // Light vector
private final int dirIntensity = 4096; // Light intensity
private final int ambIntensity = 1755; // Ambient light intensity

...
light = new Light(dir,dirIntensity,ambIntensity);
effect = new Effect3D( light, Effect3D.NORMAL_SHADING, true, null);
g3.renderFigure(figure, 0, 0, layout, effect);

...

5 投影

你可以3D模型上使用透视或平行投影。通过简单的调用实现两者间转换。

// Camera distance
private final static int persNear = 1; // Minimum distance to the camera
private final static int persFar = 4096; // Maximum distance to the camera
private final static int persAngle = 682; // Angle

...
//Setting the projection method
if(persEnabled){
 layout.setPerspective(persNear, persFar, persAngle);
}else{
 layout.setParallelSize(800, 800);
}

6 旋转模型

本文关键:精通Micro3D v3基础技术
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top