Skip to content

Instantly share code, notes, and snippets.

View EncodeTheCode's full-sized avatar
💭
Coding useful tools for workflow.

EncodeTheCode

💭
Coding useful tools for workflow.
View GitHub Profile
import numpy as np
import time
def rotation_matrix(axis, theta):
axis = axis / np.linalg.norm(axis)
a = np.cos(theta / 2.0)
b, c, d = -axis*np.sin(theta / 2.0)
aa, bb, cc, dd = a*a, b*b, c*c, d*d
bc, ad, ac, ab, bd, cd = b*c, a*d, a*c, a*b, b*d, c*d
return np.array([[aa+bb-cc-dd, 2*(bc+ad), 2*(bd-ac), 0],
import numpy as np
import time
from math import cos, sin, acos, sqrt
# --- Quaternion utility functions for rotations ---
def quat_from_axis_angle(axis, angle_rad):
axis = axis / np.linalg.norm(axis)
s = sin(angle_rad / 2)
return np.array([cos(angle_rad/2), axis[0]*s, axis[1]*s, axis[2]*s])
import pygame as g, sys, math
import numpy as n
# Init
g.init()
s = g.display.set_mode((800, 600))
w, h = s.get_size()
g.display.set_caption("3D LOS with NumPy Optimization")
c = g.time.Clock()
g.event.set_grab(True)
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import numpy as np
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
import pygame
import sys
import math
# Initialize Pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("3D Line of Sight with Mouse Look")
clock = pygame.time.Clock()
pygame.event.set_grab(True)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy