Skip to content

Instantly share code, notes, and snippets.

View vyhuynhthanh's full-sized avatar

Vy Huỳnh vyhuynhthanh

View GitHub Profile
@nikAizuddin
nikAizuddin / OpenGL 2.1 Draw3D Cylinder
Last active May 16, 2023 06:39
This program will draw a 3D cylinder using OpenGL 2.1 API
/*------------------------------------------------------------------+
| |
| This program will draw a 3D cylinder using OpenGL 2.1 API |
| |
| Language: C89 strict |
| Compiler: GNU GCC 4.8.3 |
| |
| Tested on Fedora 19 64-bit and Windows 7 64-bit, |
| both works with no errors and no warnings :) |
| |
@gyng
gyng / torus.cpp
Last active April 29, 2022 11:05
OpenGL torus with texture mapping and normals
/*
r = torus ring radius
c = torus tube radius
rSeg, cSeg = number of segments/detail
*/
void drawTorus(double, double, int, int, int);
void drawTorus(double r = 0.07, double c = 0.15,
int rSeg = 16, int cSeg = 8,
@eliben
eliben / gist:5797351
Created June 17, 2013 14:36
Generic regex-based lexer in Python
#-------------------------------------------------------------------------------
# lexer.py
#
# A generic regex-based Lexer/tokenizer tool.
# See the if __main__ section in the bottom for an example.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
# Last modified: August 2010
#-------------------------------------------------------------------------------