Skip to content

Instantly share code, notes, and snippets.

View JSiapo's full-sized avatar
🏠
Working from home

José Siapo JSiapo

🏠
Working from home
View GitHub Profile
@JSiapo
JSiapo / VPN
Created February 2, 2018 04:35
sudo apt-get install libpkcs11-helper1 network-manager-openvpn openvpn libpkcs11-helper1 openvpn resolvconf network-manager-pptp pptp-linux network-manager-openvpn-gnome network-manager-pptp-gnome
void circuGeneral(GLint xc, GLint yc, GLint r){
int x;
double y1,y2;
for(x=xc-r;x<=xc+r ;x+=1){
y1=yc+sqrt(r*r-((x-xc)*(x-xc)));
cout<<"y: "<<y1<<"\t";
y2=yc-sqrt(r*r-((x-xc)*(x-xc)));
pintarPixel(x,roundf(y1));
pintarPixel(x,roundf(y2));
}
@JSiapo
JSiapo / OpenGL.cpp
Created November 13, 2017 03:39
Inicializar OpenGL en C++
/*Libreria usada solo en Windows - debe ir antes que la libreria GL/glut.h */
#include<windows.h>
/*Libreria del OpenGL*/
#include<GL/glut.h>
void draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
/*todo lo que se quiera pintar*/
glFlush();
@JSiapo
JSiapo / DDA.cpp
Created November 10, 2017 16:59
Algoritmo DDA para líneas
void DDA (GLint x1,GLint y1,GLint x2,GLint y2)
{
float ax,ay,x,y,res;
GLint i;
if(abs(x2-x1)>=abs(y2-y1))
//si la variacion en x es mayor o igual que la variacion en y
res=abs(x2-x1);
else
//si la variacion en y es mayor que la variacion en x
res=abs(y2-y1);
h1{
text-align: center;
-webkit-text-fill-color: #0345fa8e;
text-shadow: 1px 1px 1px rgba(13, 147, 236, 0.5);/*sombra*/
}