Skip to content

Instantly share code, notes, and snippets.

View vpenades's full-sized avatar
💭
I may be slow to respond.

Vicente Penades vpenades

💭
I may be slow to respond.
  • Rehametrics
  • Valencia, Spain
View GitHub Profile
@vpenades
vpenades / MatrixNormalize.cs
Last active April 17, 2020 18:00
Matrix4x4 normalization
public static void NormalizeMatrix(ref Matrix4x4 xform)
{
var vx = new Vector3(xform.M11, xform.M12, xform.M13);
var vy = new Vector3(xform.M21, xform.M22, xform.M23);
var vz = new Vector3(xform.M31, xform.M32, xform.M33);
var lx = vx.Length();
var ly = vy.Length();
var lz = vz.Length();
@vpenades
vpenades / mesh.primitive.g.cs
Created November 6, 2017 19:37
gltf code generation example
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace glTFLoader.Schema
{
public class MeshPrimitive : GLTFChildOfRootProperty
{
private Dictionary<string, gltfId> _attributes;