CLICK ME
yes, even hidden code blocks!
print("hello world!")
Gerstner Waves | |
2D Fluid Simulation | |
Knot Rendering | |
Ant Behaviour | |
Game of Life |
import requests | |
import discord | |
from discord.ext import commands | |
import random | |
import json | |
headers = { | |
'Upgrade-Insecure-Requests': '1', | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', | |
} |
/* to map a cubemap into a texture atlas; bottom to top left to right */ | |
float faceWidth; | |
float faceHeight; | |
float atlasWidth = faceWidth*3; | |
float atlasHeight = faceHeight*2; | |
for(int i = 0; i < 2; i++) | |
for(int z = 0; z < 3; z++) |
//Based on explanation http://www.hiddendimension.com/fractalmath/Divergent_Fractals_Main.html | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 c = fragCoord.xy / iResolution.xy; | |
//scaling real axis to [-2.5, 1.5] and imaginary axis to [-1.5, 1.5] | |
c = c * vec2(4,3) - vec2(2.5, 1.5); | |
vec2 z = vec2(0); | |
fragColor = vec4(0); | |
//Based on explanation http://www.hiddendimension.com/fractalmath/Divergent_Fractals_Main.html | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 c = fragCoord.xy / iResolution.xy; | |
//scaling real axis to [-2.5, 1.5] and imaginary axis to [-1.5, 1.5] | |
c = c * vec2(4,3) - vec2(2.5, 1.5); | |
vec2 z = vec2(0); | |
fragColor = vec4(0); | |
private void OnTriggerEnter(Collider other) | |
{ | |
Debug.Log("Collided with " + other.transform.name); | |
Vector3 rbVelocity = Actor.RigidbodyComp.velocity; | |
Vector3 direction = transform.position - GetComponent<Collider>().transform.position; | |
direction.Normalize(); | |
Actor.RigidbodyComp.velocity = Vector3.zero; | |
Actor.RigidbodyComp.AddForce(-rbVelocity.normalized * force, ForceMode.Impulse); |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
void Start () | |
{ | |
} |
// Y - Vertical | |
//XZ - Horizontal | |
public static Vector3 DirFromAngle (float xa, float ya) | |
{ | |
float x = Mathf.Cos(xa * Mathf.Deg2Rad) * Mathf.Cos(ya * Mathf.Deg2Rad); | |
float y = Mathf.Sin(xa * Mathf.Deg2Rad); | |
float z = Mathf.Cos(xa * Mathf.Deg2Rad) * Mathf.Sin(ya * Mathf.Deg2Rad); | |
return new Vector3(x, y, z).normalized; | |
} |