游戏建模控件Aspose.3D for Java最新版支持在Wavefront OBJ中添加点云支持
生活随笔
收集整理的這篇文章主要介紹了
游戏建模控件Aspose.3D for Java最新版支持在Wavefront OBJ中添加点云支持
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Aspose.3D for Java是獨立的Gameware和計算機(jī)輔助設(shè)計(CAD)API,用于處理3D文件。同時支持大多數(shù)流行的3D文件格式,應(yīng)用程序可以輕松創(chuàng)建,讀取,轉(zhuǎn)換和修改3D文件。此外,API還可以幫助開發(fā)人員在游戲中建模和創(chuàng)建大量世界,為設(shè)計可視化創(chuàng)建出色的場景,參與虛擬現(xiàn)實體驗,將動畫屬性添加到3D場景文件,使用3D變換格式化元素等等。
在最新版的Aspose.3D for Java v19.8中,新增在Wavefront OBJ中添加點云支持,增強(qiáng)Aspose.3D的安全性審查,修復(fù)DRC到STL轉(zhuǎn)換失敗等多項問題,下面我們用示例來演示該功能的使用和工作原理。
在com.aspose.threed.ObjSaveOptions類中添加了新的getter / setter PointCloud
/***?Gets?the?flag?whether?the?exporter?should?export?the?scene?as?point?cloud(without?topological?structure),?default?value?is?false*/ public?boolean?getPointCloud(); /***?Sets?the?flag?whether?the?exporter?should?export?the?scene?as?point?cloud(without?topological?structure),?default?value?is?false*?@param?value?New?value*/ public?void?setPointCloud(boolean?value);示例代碼生成一個obj格式的球面點云。
Scene?scene?=?new?Scene(new?Sphere()); ObjSaveOptions?opt?=?new?ObjSaveOptions(); opt.setPointCloud(true); scene.save("sphere.obj",?opt);添加了新方法createPolygon com.aspose.threed.Mesh
/***?Create?a?polygon?with?4?vertices(quad)*?@param?v1?Index?of?the?first?vertex*?@param?v2?Index?of?the?second?vertex*?@param?v3?Index?of?the?third?vertex*?@param?v4?Index?of?the?fourth?vertex*/ public?void?createPolygon(int?v1,?int?v2,?int?v3,?int?v4); /***?Create?a?polygon?with?3?vertices(triangle)*?@param?v1?Index?of?the?first?vertex*?@param?v2?Index?of?the?second?vertex*?@param?v3?Index?of?the?third?vertex*/ public?void?createPolygon(int?v1,?int?v2,?int?v3);示例代碼:
Mesh?mesh?=?new?Mesh(); mesh.createPolygon(new?int[]?{?0,?1,?2?});?//The?old?CreatePolygon?needs?to?create?a?temporary?array?for?holding?the?face?indices mesh.createPolygon(0,?1,?2);?//The?new?overloads?doesn't?need?extra?allocation,?and?it's?optimized?internally.在com.aspose.threed.GLTFSaveOptions類中添加了新的getter/setter PrettyPrint
/** *?The?JSON?content?of?GLTF?file?is?indented?for?human?reading,?default?value?is?false */ public?boolean?getPrettyPrint(); /** *?The?JSON?content?of?GLTF?file?is?indented?for?human?reading,?default?value?is?false *?@param?value?New?value */ public?void?setPrettyPrint(boolean?value);舊的prettyPrint是一個公共領(lǐng)域,它已被財產(chǎn)取代以保持一致。示例代碼:
Scene?scene?=?new?Scene(new?Sphere()); GLTFSaveOptions?opt?=?new?GLTFSaveOptions(FileFormat.GLTF2); //opt.prettyPrint?=?true;?//Old?code opt.setPrettyPrint(true);?//Use?setter?to?change?this?configuration. scene.save("sphere.gltf",?opt);?
總結(jié)
以上是生活随笔為你收集整理的游戏建模控件Aspose.3D for Java最新版支持在Wavefront OBJ中添加点云支持的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 发表SCI或EI类英文文章的投稿经验
- 下一篇: Java字节序与大小端转换_什么时候要进