项目作者: LeLocTai

项目描述 :
C# rock generator
高级语言: C#
项目地址: git://github.com/LeLocTai/rock-generator.git
创建时间: 2020-04-23T09:40:52Z
项目社区:https://github.com/LeLocTai/rock-generator

开源协议:Other

下载


Rock Generator

WIP.

Demo: http://leloctai.com/rock-generator/

Everything in the RockGen namespace should work with netstandard 2.0, outside of Unity.

For use in Unity, some type conversion is required.

Example

  1. // No default are provided at the moment
  2. // Check out the demo page to see what each setings does
  3. var settings = new RockGenerationSettings {
  4. GridSettings = new VoronoiGridSettings {
  5. Size = 5,
  6. Randomness = .75f
  7. },
  8. StockDensity = 8,
  9. TargetTriangleCount = 220,
  10. Distortion = .5f,
  11. PatternSize = 1.35f,
  12. Transform = Convert.FromUnityMatrix(UnityEngine.Matrix4x4.TRS(new Vector3(2, 2, 2),
  13. Quaternion.identity,
  14. Vector3.one))
  15. };
  16. generator = new RockGenerator {Settings = settings};
  17. GetComponent<MeshFilter>().mesh = Convert.ToUnityMesh(generator.MakeRock());

Look at the Rock Fountain sample for more details.

Dependencies

TODO

  • Simpler work flow in Unity.

Sponsors

Me. My free Unity assets are backed by my paid one. Check them out: