项目
在 GitHub 查看
karl-/pb_CSG
关于
Evan W 开发的 CSG.js 的 C# 移植版(http://evanw.github.io/csg.js/)。
游戏与模拟器实测星标增长
- 24小时
- -1
- 7天
- -1
- 15天
- -2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文pb_CSG
A C# port of CSG.js by Evan W for use in the Unity game engine.
Install
To install, simply check out this repository in the My Project/Packages directory.
cd My\ Project/Packages
git clone https://github.com/karl-/pb_CSG.git co.parabox.csg
Quick Start
pb_CSG provides an interface in the CSG class for creating new meshes from boolean operations. Each function (Union, Subtract, Intersect) accepts 2 gameObjects: the left and right side. A new mesh is returned.
Example use:
// Include the library
using Parabox.CSG;
...
// Initialize two new meshes in the scene
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
sphere.transform.localScale = Vector3.one * 1.3f;
// Perform boolean operation
Model result = CSG.Subtract(cube, sphere);
// Create a gameObject to render the result
var composite = new GameObject();
composite.AddComponent<MeshFilter>().sharedMesh = result.mesh;
composite.AddComponent<MeshRenderer>().sharedMaterials = result.materials.ToArray();
Result:
探索相关项目
加载中…