Skip to content

Instantly share code, notes, and snippets.

View antoinefortin's full-sized avatar

Antoine Fortin antoinefortin

  • Montreal, Canada
View GitHub Profile
#include <iostream>
#include <intrin.h>
#include <cmath>
uint64_t rdtsc() {
return __rdtsc();
}
float random0t1(uint64_t cpuClock)
{
float parcels = abs(sin(cpuClock) * cos(sin(cpuClock / 2)));
4b61 7964 6172 6120 4642 5820 4269 6e61
7279 2020 001a 00e8 1c00 0096 0700 0000
0000 0000 0000 0012 4642 5848 6561 6465
7245 7874 656e 7369 6f6e 5c00 0000 0100
0000 0500 0000 1046 4258 4865 6164 6572
5665 7273 696f 6e49 eb03 0000 7800 0000
0100 0000 0500 0000 0a46 4258 5665 7273
696f 6e49 e81c 0000 9800 0000 0100 0000
0500 0000 0e45 6e63 7279 7074 696f 6e54
7970 6549 0000 0000 8101 0000 0000 0000
{
"myApp": "dick"
}
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 m = iMouse.xy/iResolution.xy;
float speed = .1;
float scale = 0.0095;
vec2 p = fragCoord * scale;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
public Matrix4x4 GetScaleTransform(
ref Vector4 inVert,
float xScale,
float yScale,
float zScale
)
{
Matrix4x4 sm = new Matrix4x4();
// r0
sm.m00 = xScale;
/*
[ 1 0 0 x ]
[ 0 1 0 y ]
[ 0 0 1 z ]
[ 0 0 0 1 ]
*/
public void TranslateTransform(
ref Vector4 inVert,
float xT,
float yT,
// Modify the Vertices List
for (int i = 0; i < listVert.Length; i++)
{
TranslateTransform(ref listVert[i], translate.x, translate.y, translate.z);
}
void OnDrawGizmosSelected()
{
Gizmos.color = Color.red;
listVert[0] = vert0;
listVert[1] = vert1;
listVert[2] = vert2;
for (int i = 0; i < listVert.Length; i++)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MatricesDemo : MonoBehaviour
{
static Vector4 vert0 = new Vector4(0.0f, 0.0f, 0.0f, 1.0f);
static Vector4 vert1 = new Vector4(10.0f, 0.0f, 0.0f, 1.0f);
static Vector4 vert2 = new Vector4(0.0f, 10.0f, 0.0f, 1.0f);