Skip to content

Instantly share code, notes, and snippets.

View orangeduck's full-sized avatar

Daniel Holden orangeduck

View GitHub Profile
def quat_from_xform(ts):
return quat_normalize(
torch.where((ts[...,2,2] < 0.0)[...,None],
torch.where((ts[...,0,0] > ts[...,1,1])[...,None],
torch.cat([
(ts[...,2,1]-ts[...,1,2])[...,None],
(1.0 + ts[...,0,0] - ts[...,1,1] - ts[...,2,2])[...,None],
(ts[...,1,0]+ts[...,0,1])[...,None],
(ts[...,0,2]+ts[...,2,0])[...,None]], dim=-1),
@orangeduck
orangeduck / loadimage.c
Created September 28, 2012 13:41 — forked from flightcrank/loadimage.c
sdl load image function
//Global variables
SDL_Surface *title_screen;
int load_image(char filename[], SDL_Surface **surface) {
SDL_Surface *temp;
//load image
temp = SDL_LoadBMP(filename);