Skip to content

Commit 70e9b37

Browse files
committed
0.9.7
1 parent cc488e1 commit 70e9b37

File tree

5 files changed

+113
-0
lines changed

5 files changed

+113
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# eppz! `Geometry`
22

3+
* 0.9.7
4+
5+
+ Triangulation
6+
+ Feature ready (`Triangle.Net` beta 4 hooked up)
7+
+ API is not quiet done yet
8+
39
* 0.9.5
410

511
+ Namings
37.6 KB
Binary file not shown.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Copyright (c) 2017 Geri Borbás http://www.twitter.com/_eppz
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7+
//
8+
using UnityEngine;
9+
using System.Collections.Generic;
10+
11+
12+
namespace EPPZ.Geometry.Scenes
13+
{
14+
15+
16+
using AddOns;
17+
using Model;
18+
using Lines;
19+
20+
21+
/// <summary>
22+
/// 11. Polygon triangulation
23+
/// </summary>
24+
public class Controller_11 : MonoBehaviour
25+
{
26+
27+
public Source.Polygon star;
28+
public TriangulatorType triangulator;
29+
public Color color;
30+
public MeshFilter meshFilter;
31+
32+
void Update()
33+
{
34+
meshFilter.mesh = star.polygon.Mesh(color, triangulator);
35+
}
36+
}
37+
}
4.35 KB
Binary file not shown.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Shader "eppz!/Geometry/Vertex color"
2+
{
3+
4+
Properties
5+
{ }
6+
7+
8+
SubShader
9+
{
10+
11+
12+
Tags {"Queue" = "Transparent"}
13+
Pass
14+
{
15+
16+
17+
Cull Off
18+
Lighting Off
19+
ZWrite Off
20+
ZTest Always
21+
Blend SrcAlpha OneMinusSrcAlpha // Alpha blending
22+
23+
24+
CGPROGRAM
25+
26+
#pragma vertex vert
27+
#pragma fragment frag
28+
#pragma fragmentoption ARB_precision_hint_fastest
29+
#include "UnityCG.cginc"
30+
31+
32+
struct vertexInput
33+
{
34+
float4 vertex : POSITION;
35+
float4 color : COLOR;
36+
float4 texcoord : TEXCOORD0;
37+
};
38+
39+
struct vertexOutput
40+
{
41+
float4 position : SV_POSITION;
42+
float4 color : COLOR; // Vertex color
43+
float2 uv : TEXCOORD0;
44+
};
45+
46+
47+
vertexOutput vert (vertexInput input)
48+
{
49+
vertexOutput output;
50+
51+
// Usual projection stuff.
52+
output.position = mul(UNITY_MATRIX_MVP, input.vertex);
53+
output.color = input.color;
54+
output.uv = input.texcoord;
55+
56+
return output;
57+
}
58+
59+
half4 frag (vertexOutput input) : COLOR
60+
{
61+
// Color (vertex).
62+
half4 output = input.color;
63+
return output;
64+
}
65+
66+
67+
ENDCG
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)