Skip to content

Instantly share code, notes, and snippets.

View IRCSS's full-sized avatar

Shahriar Shahrabi IRCSS

View GitHub Profile
@IRCSS
IRCSS / Moebius3d
Created September 22, 2020 21:53 — forked from Dan-Piker/Moebius3d
Moebius transformations in 3d
//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.
### 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 = []
@IRCSS
IRCSS / SmoothGameCameraMovement.cs
Last active May 10, 2023 03:03
Unity Camera Movement in Game view like Scene View with filtering
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;
@IRCSS
IRCSS / Raymarcher.shader
Created September 20, 2019 11:53
Raymarcher Shader
// ===================================================================================================================
// 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
{