forked from mbanquiero/TallerAlgebra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mbanquiero
committed
Mar 11, 2016
0 parents
commit 500a5b0
Showing
57 changed files
with
41,545 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Compiled Object files | ||
|
||
*.slo | ||
|
||
*.lo | ||
|
||
*.o | ||
|
||
*.obj | ||
|
||
*.exe | ||
|
||
|
||
# Compiled Dynamic libraries | ||
|
||
*.so | ||
|
||
*.dylib | ||
|
||
|
||
# Compiled Static libraries | ||
|
||
*.lai | ||
|
||
*.la | ||
|
||
*.a | ||
|
||
*/Debug* | ||
|
||
*Release* | ||
|
||
ipch | ||
*.sdf | ||
*.sln | ||
*.vcxproj | ||
/TGCViewer/*.filters | ||
*.user | ||
*.filters | ||
*.ncb | ||
*.opt | ||
*.plg | ||
*.suo | ||
*.vcproj | ||
Debug |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<script type="text/javascript"> | ||
|
||
var canvas; | ||
var ctx; | ||
|
||
// | ||
// Ejemplo de bilinear sampling | ||
// | ||
|
||
|
||
var diff_map = []; | ||
|
||
function CreateTexture() | ||
{ | ||
for(var i=0;i<4;++i) | ||
for(var j=0;j<4;++j) | ||
diff_map[i+4*j] = {r:128 , g:128, b:128}; | ||
|
||
diff_map[1+4*1] = {r:255 , g:0, b:0}; | ||
diff_map[2+4*1] = {r:0 , g:255, b:0}; | ||
diff_map[1+4*2] = {r:0 , g:0, b:255}; | ||
diff_map[2+4*2] = {r:255 , g:255, b:255}; | ||
} | ||
|
||
function tex2d(u, v) | ||
{ | ||
var du = 4; | ||
var dv = 4; | ||
|
||
u -= 0.5/du; | ||
v -= 0.5/dv; | ||
var r = u*du; | ||
var s = v*dv; | ||
var i = r<0 ? du-1 : r|0 | ||
var j = s<0 ? dv-1 : s|0 | ||
var ri = r-i; | ||
var rj = s-j; | ||
var i1 = i<du-1?i+1:0; | ||
var j1 = j<dv-1?j+1:0; | ||
if(ri<0) | ||
ri+=du; | ||
if(rj<0) | ||
rj+=dv; | ||
|
||
var c00 = diff_map[i+dv*j]; | ||
var c01 = diff_map[i+dv*j1]; | ||
var c11 = diff_map[i1+dv*j1]; | ||
var c10 = diff_map[i1+dv*j]; | ||
|
||
var red = (c00.r * (1-ri)*(1-rj) + c10.r*ri*(1-rj) + c11.r*ri*rj + c01.r*(1-ri)*rj) | 0; | ||
var green = (c00.g * (1-ri)*(1-rj) + c10.g*ri*(1-rj) + c11.g*ri*rj + c01.g*(1-ri)*rj) | 0; | ||
var blue = (c00.b * (1-ri)*(1-rj) + c10.b*ri*(1-rj) + c11.b*ri*rj + c01.b*(1-ri)*rj) | 0; | ||
|
||
return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',255)'; | ||
|
||
} | ||
|
||
|
||
|
||
function draw() | ||
{ | ||
if (canvas.getContext) | ||
{ | ||
ctx.fillStyle = 'rgba(240,240,240,255)'; | ||
ctx.fillRect(0,0,1000,800); | ||
|
||
var k = 5; | ||
for(var i=0;i<=125;++i) | ||
for(var j=0;j<=125;++j) | ||
{ | ||
ctx.fillStyle = tex2d(i/125,j/125); | ||
ctx.fillRect(10+i*k,10+j*k,k,k); | ||
} | ||
} | ||
} | ||
|
||
function animate() | ||
{ | ||
canvas = document.getElementById('mycanvas'); | ||
ctx = canvas.getContext('2d'); | ||
CreateTexture(); | ||
draw(); | ||
} | ||
|
||
|
||
|
||
|
||
</script> | ||
</head> | ||
<body onload="animate();"> | ||
<canvas id="mycanvas" width="1000" height="700"></canvas> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<script type="text/javascript"> | ||
|
||
var canvas; | ||
var ctx; | ||
|
||
// | ||
// Ejemplo de bilinear sampling | ||
// | ||
|
||
|
||
var diff_map = []; | ||
|
||
function CreateTexture() | ||
{ | ||
var dt = 32; | ||
for(var i=0;i<dt;++i) | ||
for(var j=0;j<dt;++j) | ||
{ | ||
var x = i-16; | ||
var y = j-16; | ||
var fx = Math.sqrt(x*x + y*y); | ||
if( Math.abs(fx - 6)<1) | ||
diff_map[i+dt*j] = {r:255 , g:255, b:255}; | ||
else | ||
diff_map[i+dt*j] = {r:(i/dt*255)|0 , g:(j/dt*255)|0, b:0}; | ||
} | ||
} | ||
|
||
function tex2d(u, v) | ||
{ | ||
var du = 32; | ||
var dv = 32; | ||
|
||
u -= 0.5/du; | ||
v -= 0.5/dv; | ||
var r = u*du; | ||
var s = v*dv; | ||
var i = (r<0 ? du-1 : r)|0 | ||
var j = (s<0 ? dv-1 : s)|0 | ||
var ri = r-i; | ||
var rj = s-j; | ||
var i1 = i<du-1?i+1:0; | ||
var j1 = j<dv-1?j+1:0; | ||
if(ri<0) | ||
ri+=du; | ||
if(rj<0) | ||
rj+=dv; | ||
|
||
var c00 = diff_map[i+dv*j]; | ||
var c01 = diff_map[i+dv*j1]; | ||
var c11 = diff_map[i1+dv*j1]; | ||
var c10 = diff_map[i1+dv*j]; | ||
|
||
var red = (c00.r * (1-ri)*(1-rj) + c10.r*ri*(1-rj) + c11.r*ri*rj + c01.r*(1-ri)*rj) | 0; | ||
var green = (c00.g * (1-ri)*(1-rj) + c10.g*ri*(1-rj) + c11.g*ri*rj + c01.g*(1-ri)*rj) | 0; | ||
var blue = (c00.b * (1-ri)*(1-rj) + c10.b*ri*(1-rj) + c11.b*ri*rj + c01.b*(1-ri)*rj) | 0; | ||
|
||
return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',255)'; | ||
|
||
} | ||
|
||
|
||
|
||
function draw() | ||
{ | ||
if (canvas.getContext) | ||
{ | ||
ctx.fillStyle = 'rgba(240,240,240,255)'; | ||
ctx.fillRect(0,0,1000,800); | ||
|
||
var dt = 42; | ||
var k = 5; | ||
for(var i=0;i<=dt;++i) | ||
for(var j=0;j<=dt;++j) | ||
{ | ||
ctx.fillStyle = tex2d(i/dt,j/dt); | ||
ctx.fillRect(10+i*k,10+j*k,k,k); | ||
} | ||
} | ||
} | ||
|
||
function animate() | ||
{ | ||
canvas = document.getElementById('mycanvas'); | ||
ctx = canvas.getContext('2d'); | ||
CreateTexture(); | ||
draw(); | ||
} | ||
|
||
|
||
|
||
|
||
</script> | ||
</head> | ||
<body onload="animate();"> | ||
<canvas id="mycanvas" width="1000" height="700"></canvas> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
|
||
<script type="text/javascript"> | ||
|
||
//--------------------------------------------------------------------------------------------- | ||
|
||
function draw() | ||
{ | ||
var canvas = document.getElementById('canvas'); | ||
if(canvas.getContext) | ||
{ | ||
var ctx = canvas.getContext('2d'); | ||
ctx.beginPath(); | ||
ctx.moveTo(75,50); | ||
ctx.lineTo(100,75); | ||
ctx.lineTo(100,25); | ||
ctx.fill(); | ||
} | ||
} | ||
|
||
|
||
|
||
</script> | ||
</head> | ||
<body onload="draw();"> | ||
<canvas id="canvas" width="1000" height="700"></canvas> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
|
||
<script type="text/javascript"> | ||
|
||
//--------------------------------------------------------------------------------------------- | ||
|
||
function draw() { | ||
var canvas = document.getElementById('canvas'); | ||
if (canvas.getContext){ | ||
var ctx = canvas.getContext('2d'); | ||
|
||
ctx.beginPath(); | ||
ctx.arc(75,75,50,0,Math.PI*2,true); | ||
ctx.moveTo(110,75); | ||
ctx.arc(75,75,35,0,Math.PI,false); | ||
ctx.moveTo(65,65); | ||
ctx.arc(60,65,5,0,Math.PI*2,true); | ||
ctx.moveTo(95,65); | ||
ctx.arc(90,65,5,0,Math.PI*2,true); | ||
ctx.stroke(); | ||
} | ||
} | ||
|
||
|
||
</script> | ||
</head> | ||
<body onload="draw();"> | ||
<canvas id="canvas" width="1000" height="700"></canvas> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.