📄 vclipexample.java
字号:
package vclip;import vclip.*;import javax.vecmath.*;import java.util.HashMap;class VclipExample{ public static void main (String[] args) { try { HashMap library = new HashMap(); PolyTree.scanLibrary ("PolyTreeExamples.txt", library, true); PolyTree ptree1 = (PolyTree)library.get("unit-cube"); PolyTree ptree2 = (PolyTree)library.get("cone"); DistanceReport drep = new DistanceReport(); ClosestFeaturesHT ht = new ClosestFeaturesHT(); Matrix4d X21 = new Matrix4d(); for (double x=10; x>=0; x-=1) { X21.set (new Vector3d (x, 0, 0)); double dist = ptree1.vclip (drep, ptree2, X21, 0, ht); if (dist > 0) { System.out.println (dist); } else { System.out.println ("colliding"); System.out.println(dist); } } } catch (Exception e) { e.printStackTrace(); System.exit(1); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -