This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class vector1 | |
{ | |
public float x, y, z; | |
public vector1(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } | |
public float this[int key] | |
{ | |
get { return (key == 0) ? x : (key == 1) ? y : z; } | |
set { if (key == 0) x = value; else if (key == 1) y = value; else z = value; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static fCurveGameObject MakeBackgroundMeshBorder(HUDShape Shape, float LineWidth, Colorf LineColor) | |
{ | |
if (Shape.Type == HUDShapeType.Disc) { | |
fCircleGameObject go = GameObjectFactory.CreateCircleGO("border", Shape.Radius, LineColor, LineWidth); | |
go.SetSteps(Shape.Slices); | |
return go; | |
} else if (Shape.Type == HUDShapeType.Rectangle) { | |
List<Vector3f> Vertices = new List<Vector3f>() { | |
new Vector3f(-Shape.Width / 2, 0, -Shape.Height / 2), | |
new Vector3f(Shape.Width / 2, 0, -Shape.Height / 2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2017-05-13 03:13:20.112] [Info] Installation ID: 14d6dc45-bf24-45fe-a790-c834d82648df | |
[2017-05-13 03:13:20.114] [Info] Operating system: Mac OS X v10.11.6 (10.11.6; Mac OS X 10.11.6 (10.11.6 build version: 15G1217)), 64-bit | |
[2017-05-13 03:13:20.115] [Info] Installer product: Visual Studio | |
[2017-05-13 03:13:20.115] [Info] Installer version: 4.0.0.308 (HEAD detached at 1d420fd9) (1d420fd9f355adc77406dc2ec9677b6c2bd7ff14 on 11/05/2017 13:22:51) | |
[2017-05-13 03:13:20.115] [Info] Status: in progress | |
[2017-05-13 03:13:21.161] [Debug] Waiting for manifests to finish downloading. | |
[2017-05-13 03:13:21.161] [Debug] Initial task executing (WaitingForActivation). Waiting for it to finish. | |
[2017-05-13 03:13:21.368] [Info] Retrieving installation manifest. | |
[2017-05-13 03:13:21.368] [Info] Downloading from 'https://www.xamarin.com/installer_assets/v3/vsmac/1d420fd9f355adc77406dc2ec9677b6c2bd7ff14/Mac/Universal/InstallationManifest.xml'. | |
[2017-05-13 03:13:21.369] [Debug] Setting download timeout for 'https://www.xamarin.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make wilkinson matrix | |
int N = 7; | |
double[] matrix = new double[] { | |
3, 1, 0, 0, 0, 0, 0, | |
1, 2, 1, 0, 0, 0, 0, | |
0, 1, 1, 1, 0, 0, 0, | |
0, 0, 1, 0, 1, 0, 0, | |
0, 0, 0, 1, 1, 1, 0, | |
0, 0, 0, 0, 1, 2, 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tool that should be immediately applied on Activation. | |
// Not clear how to end it though...don't know hand! | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using g3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float voxelSize = 1.0f; | |
DMeshSO meshSO = CotangentUI.ActiveScene.FindSceneObjectsOfType<DMeshSO>()[0]; | |
AxisAlignedBox3f bounds = meshSO.GetTransformedBoundingBox(); | |
bounds.Expand(2*voxelSize); | |
Vector3i gridSize = (Vector3i)(bounds.Diagonal / voxelSize); | |
Bitmap3d bitmap = new Bitmap3d(gridSize); | |
foreach ( Vector3i idx in bitmap.Indices() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM grab latest commits from server | |
git submodule update --recursive --remote | |
REM above command will set current branch to detached HEAD. set back to master. | |
git submodule foreach git checkout master | |
REM now do pull to fast-forward to latest commit | |
git submodule foreach git pull origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// at top of Apply() | |
DMesh3 saveMesh = new DMesh3(Mesh); | |
insert_corners(); | |
DMesh3 pokedMesh = new DMesh3(Mesh); | |
// to append segments to pokedMesh (in si loop) | |
MeshEditor.AppendLine(pokedMesh, new Segment3d(Mesh.GetVertex(i0_vid), Mesh.GetVertex(i1_vid)), 0.003f); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//int N = 256; | |
//Texture2D tex = new Texture2D(N, N, TextureFormat.RFloat, false); | |
//float[] buffer = new float[N * N]; | |
//foreach (int tid in startMesh.TriangleIndices()) { | |
// int v = tid / N; | |
// int u = tid % N; | |
// int n = 0; | |
// Vector3d c = startMesh.GetTriCentroid(tid); | |
// if (c.x > startMesh.CachedBounds.Center.x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright Ryan Schmidt 2020 | |
// Released under the terms of the Boost License: https://www.boost.org/LICENSE_1_0.txt | |
static FVector ComputeMonteCarloVectorFieldSample( | |
FDynamicMesh3& Mesh, | |
FDynamicMeshAABBTree3& AABBTree, | |
FVector3d FixedDirection, // target fixed direction. This will be projected onto mesh normals to create vector field that is interpolated | |
FVector3d WorldPosition, // position we want to sample at | |
int NumSamples, // How many monte-carlo paths to compute and average | |
float Epsilon, // path is terminated when we are within Epsilon of boundary constraints (ie mesh) |
OlderNewer