Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
using System.Collections.Generic;
using ProceduralToolkit;
using ProceduralToolkit.Samples.Primitives;
using UnityEngine;
using XNode;
public enum PrimitiveType
{
Dodecahedron,
Octahedron
def gltf(request, lat, lng, distance):
scale = 100000
pnt = GEOSGeometry(f'POINT({lng} {lat})', srid=4326)
buildings = Building.objects.filter(outline__distance_lte=(pnt, D(km=distance)))
scene = Scene()
centroid_total = (0,0)
count = 0.0
{
"Name": "Snapping",
"ShapeType": "Johnson",
"PolyTypeCategory": "All",
"PolyType": "Small_Cubicuboctahedron",
"JohnsonPolyType": "Cupola",
"OtherPolyType": "L1",
"GridType": "Square",
"GridShape": "Cube",
"BypassOps": false,
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class DepthNormalsFeature : ScriptableRendererFeature
{
private DepthNormalsPass depthNormalsPass;
RenderTargetHandle m_DepthNormalsTexture;
public override void Create()
using UnityEngine;
public ChangeStuff()
{
gameobject.GetComponent<MeshRenderer>().material.color = Color.red;
transform.localScale = new Vector3(5,5,5);
}
{
"Name": "Brazier",
"ShapeType": "Uniform",
"PolyType": 39,
"JohnsonPolyType": 4,
"BypassOps": false,
"TwoSided": true,
"GridType": "Hex",
"PrismP": 5,
"PrismQ": 2,
{
"Name": "Vicious",
"ShapeType": "Uniform",
"PolyType": 29,
"JohnsonPolyType": 4,
"BypassOps": false,
"TwoSided": true,
"GridType": "Hex",
"PrismP": 5,
"PrismQ": 2,
using UnityEngine;
public static class C
{
public static Camera Cam
{
get { return Camera.main;}
}
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.XR;
public class PlayerController : MonoBehaviour
{
public Transform Player1Start;
public Transform Player2Start;