Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web gl #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/temas/michis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ description: Una descripción
##### Esto está en markdown
###### Esto está en markdown


---

# Acá tenés MICHISSSSSSSSSS:
Expand Down
14 changes: 14 additions & 0 deletions content/temas/starship/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Starship
order: 2
imagen: "./starship.jpg"
description: Un barquito
---

# El barquito va a salir

![starship](./starship.jpg)

---

*Shuu Shuu*
Binary file added content/temas/starship/starship.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19,864 changes: 19,864 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const globlalStyles = css`
`

const Header = styled.header`
background-color: black;
background-color: red;
color: white;
height: 4rem;
position: fixed;
Expand Down Expand Up @@ -48,7 +48,7 @@ const MenuItem = styled.li`
const MenuLink = styled(AniLink)`
border-bottom: solid 1px transparent;
border-radius: 4px 4px 0 0;
color: white;
color: blueviolet;
padding: 0.5rem 1rem;
text-decoration: none;
transition: background-color 0.4s ease, border-bottom-color 0.4s ease;
Expand All @@ -57,13 +57,13 @@ const MenuLink = styled(AniLink)`
}
&:focus,
&:hover {
background-color: #2f2f2f;
background-color: red;
}
`

const Main = styled.main`
align-items: center;
background-color: #1e1e1e;
background-color: red;
color: white;
display: flex;
flex-direction: column;
Expand All @@ -75,7 +75,7 @@ const Main = styled.main`

const Footer = styled.footer`
align-items: center;
background-color: black;
background-color: red;
color: white;
display: flex;
height: 6rem;
Expand Down Expand Up @@ -112,7 +112,7 @@ const Layout = ({ children }) => {
<MenuItem>
<MenuLink
activeClassName="active"
hex="#000000"
hex="#000555"
paintDrip
direction
to="/"
Expand All @@ -123,7 +123,7 @@ const Layout = ({ children }) => {
<MenuItem>
<MenuLink
activeClassName="active"
hex="#000000"
hex="#000555"
paintDrip
direction
to="/temas"
Expand Down
19 changes: 19 additions & 0 deletions webGL.P5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.0.0/p5.js"
integrity="sha512-B0E1DvRDPJy6ByeDG95rcpYD/R6KQ5NZg8eclRIMOvUhmNyNOcgOukcKhNcmlxKSn2cc/iZh2qV+H2SkvDr8uQ=="
crossorigin="anonymous"></script>
<script src="js/webgl.js"></script>
</head>

<body>
<h1>Bueno</h1>

</body>

</html>
84 changes: 84 additions & 0 deletions webGL.P5/js/webgl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
var angle = 0;
let starship;
let cam;
let vid;

function preload() {
starship = loadImage('media/starship.jpg')
}

function setup() {
createCanvas(500, 500, WEBGL);
cam = createCapture(VIDEO);
cam.size(150, 175);
cam.hide();

vid = createVideo(
'media/korn.mp4',
vidLoad
);
vid.size(100, 100);
vid.hide();
}

// This function is called when the video loads
function vidLoad() {
vid.loop();
vid.volume(0);
}


function draw() {
let dx = mouseX - width / 2;
let dy = mouseY - height / 2;
let mouseColorx = map(mouseX, 0, width, 0, 255);
let cursorZ = map(mouseY, 0, width, 0, 325)
let v = createVector(dx, dy, 0);
v.div(100);
//ambientLight(255);
directionalLight(255, 0, 255, dx, dy, 0);
pointLight(0, 0, 255, 500, 0, 0);
pointLight(0, 255, 0, 0, 200, 0);
pointLight(0, 255, 0, 0, -200, 0);
pointLight(255, mouseColorx, 100, 0, 0, 200);

background(0);

translate(0, 0, cursorZ)

push();
//fill(0, 50, 200);
//translate(mouseX - width / 2, mouseY - height / 2);
rotateX(angle);
rotateY(angle * 0.2);
rotateZ(angle * 0.2);

noStroke();
//ambientMaterial(255);
//translate(0, 0, mouseX);
texture(cam);
//filter(THRESHOLD);
box(220);
box(50);
box(20);
box(8);
box(3);
pop();
//filter(THRESHOLD);
push();
translate(0, 200);
rotateX(HALF_PI);
texture(starship);
noStroke();
//ambientMaterial(255);
plane(650, 600);
pop();

push();
translate(0, -150, 100);
rotateX(HALF_PI);
texture(starship);
noStroke();
plane(325);
angle += 0.005;
}
Binary file added webGL.P5/media/korn.mp4
Binary file not shown.
Binary file added webGL.P5/media/starship.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webGL.P5/media/the-maxx-intro.mp4
Binary file not shown.