游戏建模控件Aspose.3D for Java最新版支持在Wavefront OBJ中添加点云支持
2019-09-16 00:14
891 查看
原文链接:https://my.oschina.net/u/4087915/blog/3098647
Aspose.3D for Java是独立的Gameware和计算机辅助设计(CAD)API,用于处理3D文件。同时支持大多数流行的3D文件格式,应用程序可以轻松创建,读取,转换和修改3D文件。此外,API还可以帮助开发人员在游戏中建模和创建大量世界,为设计可视化创建出色的场景,参与虚拟现实体验,将动画属性添加到3D场景文件,使用3D变换格式化元素等等。
在最新版的Aspose.3D for Java v19.8(点击下载)中,新增在Wavefront OBJ中添加点云支持,增强Aspose.3D的安全性审查,修复DRC到STL转换失败等多项问题,下面我们用示例来演示该功能的使用和工作原理。
在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是一个公共领域,它已被财产取代以保持一致。示例代码:
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);
转载于:https://my.oschina.net/u/4087915/blog/3098647
相关文章推荐
- 3D控件Aspose.3D 12月新版V17.12发布 | 添加支持导出RVM
- 支持常用的图表、仪表和地图类型的图表控件TeeChart Java for Android
- 3D控件Aspose.3D 12月新版V17.12发布 | 添加支持导出RVM
- 2D游戏引擎(十一)—— 向游戏引擎添加滚动背景支持
- 为控件添加设计期支持
- java通过复选框控件数组实现添加多个复选框控件示例分享
- 2D游戏引擎(九)——添加背景支持
- Java表格控件支持多表头列锁定
- MFC中 添加Splash Screen控件 的问题,Splash Screen不支持此接口
- 采用Javacript编写的支持HTML5的图表控件TeeChart Chart
- 为Silverlight控件添加鼠标滚轮支持的小类
- Java Swing 控件添加事件响应
- Java实现的自定义可编辑表格控件(支持汇总、滚动、增行、删行、小数、日期、下拉列表、参照等)
- arcserver for java querytask 不支持中文
- u-boot-2010.3 添加usb下载功能支持 ( for mini2440)
- 添加条码生成和打印功能到您的ASP.NET Web的条码控件Barcode Professional for ASP.NET
- 交互式报表和工作报表控件Stimulsoft Reports.Fx for Java
- eclipse添加tomcat支持 (java基础)
- 为Silverlight控件添加鼠标滚轮支持
- GAE for java 中支持session