This file contains 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
//Moebius transformations in 3d, by reverse stereographic projection to the 3-sphere, | |
//rotation in 4d space, and projection back. | |
//by Daniel Piker 09/08/20 | |
//Feel free to use, adapt and reshare. I'd appreciate a mention if you post something using this. | |
//You can also now find this transformation as a component in Grasshopper/Rhino | |
//I first wrote about these transformations here: | |
//https://spacesymmetrystructure.wordpress.com/2008/12/11/4-dimensional-rotations/ | |
//If you want to transform about a given circle. Points on the circle and its axis stay on those curves. | |
//You can skip these 2 lines if you want to always use the origin centred unit circle. |
This file contains 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
### creates a series of planes lined up along one axis. I use this as a basis for a particle system when | |
### I dont have access to compute shader or a cache friendly enviroment | |
import bpy | |
import bmesh | |
#mesh arrays | |
m_verts = [] | |
m_faces = [] |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Moves Camera similar to how camera is moved in the Unity view port. Drop the scrip on the game object which has the camera and you wish to move. | |
public class SmoothGameCameraMovement : MonoBehaviour | |
{ | |
public float lateralSpeed = 0.0015f; |
This file contains 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
// =================================================================================================================== | |
// Raymarching shader. The shader uses code from two sources. One articles by iq https://www.iquilezles.org/www/articles/terrainmarching/terrainmarching.htm | |
// Another source is for the PBR lighting, the lighting is abit of an over kills, https://github.com/Nadrin/PBR/blob/master/data/shaders/hlsl/pbr.hlsl | |
// =================================================================================================================== | |
Shader "Unlit/Raymarcher" | |
{ | |
SubShader | |
{ |