Skip to content

Instantly share code, notes, and snippets.

View davidwparker's full-sized avatar
🙃
Living in the Upside Down

Parker Parker davidwparker

🙃
Living in the Upside Down
View GitHub Profile
@davidwparker
davidwparker / shapes.h
Created September 27, 2011 22:02
OpenGL Screencast 11 part 3: Code Organization
void cube(double x,double y,double z,
double dx,double dy,double dz,
double th);
void cone(double x,double y,double z,
double r,double h,int deg);
@davidwparker
davidwparker / initialization.c
Created September 27, 2011 22:01
OpenGL Screencast 11 part 2: Code Organization
#include "screencasts.h"
void initializeGlobals()
{
windowName = "OpenGL screenscasts 11: Code Organization";
windowWidth = 500;
windowHeight = 450;
toggleAxes = 0;
toggleValues = 1;
@davidwparker
davidwparker / 011.c
Created September 27, 2011 21:56
OpenGL Screencast 11: Code Organization
#include "screencasts.h"
/*
* main()
* ----
* Start up GLUT and tell it what to do
*/
int main(int argc,char* argv[])
{
initializeGlobals();
@davidwparker
davidwparker / 010.c
Created September 21, 2011 21:42
OpenGL Screencast 10: Push and Pop Matrix and Complex Objects
#include "screencasts.h"
/* Poor man's approximation of PI */
#define PI 3.1415926535898
/* Macro for sin & cos in degrees */
#define Cos(th) cos(PI/180*(th))
#define Sin(th) sin(PI/180*(th))
/* D degrees of rotation */
#define DEF_D 5
@davidwparker
davidwparker / 009.c
Created September 12, 2011 21:24
OpenGL Screencast 9: Rotation, Scaling, and Translations
#include "screencasts.h"
/* Poor man's approximation of PI */
#define PI 3.1415926535898
/* Macro for sin & cos in degrees */
#define Cos(th) cos(PI/180*(th))
#define Sin(th) sin(PI/180*(th))
/* Globals */
double dim=3.0; /* dimension of orthogonal box */
@davidwparker
davidwparker / 008.c
Created September 5, 2011 20:31
OpenGL Screencast 8: Drawing in 3d part 3: spheres, cylinders, and cones
#include "screencasts.h"
/* Poor man's approximation of PI */
#define PI 3.1415926535898
/* Macro for sin & cos in degrees */
#define Cos(th) cos(PI/180*(th))
#define Sin(th) sin(PI/180*(th))
/* D degrees of rotation */
#define DEF_D 5
@davidwparker
davidwparker / layout.xml
Created August 30, 2011 22:28
Android floating bottom row above soft keyboard
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<ScrollView
android:id="@+id/scrollview"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_above="@+id/m_table_menu">
@davidwparker
davidwparker / 007.c
Created August 28, 2011 17:10
OpenGL screenscasts 7: Drawing in 3d part 2: Cubes, Perspective and Orthogonal Projections
#include "screencasts.h"
/* Poor man's approximation of PI */
#define PI 3.1415926535898
/* Macro for sin & cos in degrees */
#define Cos(th) cos(PI/180*(th))
#define Sin(th) sin(PI/180*(th))
/* Globals */
double dim=3.0; /* dimension of orthogonal box */
@davidwparker
davidwparker / layout.xml
Created August 26, 2011 04:29
Android scroll and window resizing
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:id="@+id/scrollview"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:isScrollContainer="true">
<TableLayout
android:layout_height="match_parent"
android:layout_width="fill_parent"
@davidwparker
davidwparker / 006.c
Created August 20, 2011 23:24
OpenGL Screencast 6: drawing in 3d with GLUT objects
#include "screencasts.h"
/* Globals */
double dim=3.0; /* dimension of orthogonal box */
char *windowName = "OpenGL screenscasts 6: Drawing in 3d part 1: GLUT objects";
int windowWidth=500;
int windowHeight=450;
/* Various global state */
/* Toggles */