Skip to content

Instantly share code, notes, and snippets.

@stephanmg
stephanmg / Unity3D Cone Generator
Last active September 18, 2020 06:45 — forked from gszauer/Unity3D Cone Generator
Cone and truncated cone generator
using UnityEngine;
using UnityEditor;
using System.Collections;
// an Editor method to create a cone primitive (so far no end caps)
// the top center is placed at (0/0/0)
// the bottom center is placed at (0/0/length)
// if either one of the radii is 0, the result will be a cone, otherwise a truncated cone
// note you will get inevitable breaks in the smooth shading at cone tips
// note the resulting mesh will be created as an asset in Assets/Editor
@stephanmg
stephanmg / Cone.cs
Last active September 18, 2020 06:45 — forked from mattatz/Cone.cs
Example of a cone mesh creator for Unity.
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (MeshFilter))]
public class Cone : MonoBehaviour {
/// subdivision
public int subdivisions = 10;
/// height and radius
public float radius = 1f;
@stephanmg
stephanmg / introrx.md
Last active November 27, 2018 20:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@stephanmg
stephanmg / 3dhull.cpp
Last active June 15, 2018 13:14 — forked from msg555/3dhull.cpp
3D Convex Hull
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cassert>
using namespace std;