This file contains hidden or 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
| if (sphereDistance(currentPosition, sphereCenter, 1.0) < 0.) { | |
| vec3 normal = (currentPosition - sphereCenter); | |
| float dotLight = dot(normal, ligthDirection) * 0.5 + 0.5; | |
| gl_FragColor = vec4(vec3(1.0, 0.5, 0.2) * dotLight, 1.0); | |
| return; | |
| } |
This file contains hidden or 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
| void main(void) { | |
| vec3 rayDir = normalize(vPosition - vEyePosition); | |
| float distanceFromSurface = 0.0; | |
| for (int i = 0; i < 100; i++) { | |
| vec3 currentPosition = vPosition + distanceFromSurface * rayDir; | |
| if (sphereDistance(currentPosition, vec3(0,1,0), 1.0) < 0.){ | |
| gl_FragColor = vec4(rayDir, 1.0); | |
| return; | |
| } |
This file contains hidden or 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
| float sphereDistance(vec3 point, vec3 sphereOrigin, float sphereRadius) { | |
| return length(point - sphereOrigin) - sphereRadius; | |
| } | |
| void main(void) { | |
| vec3 rayDir = normalize(vPosition - vEyePosition); | |
| if (sphereDistance(vPosition, vec3(0,1,0), 1.1) > 0.) | |
| discard; | |
| gl_FragColor = vec4(rayDir, 1.0); | |
| } |
This file contains hidden or 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
| void main(void) { | |
| vec3 rayDir = normalize(vPosition - vEyePosition); | |
| gl_FragColor = vec4(rayDir,1.0); | |
| } |
This file contains hidden or 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
| void main(void) { | |
| gl_FragColor = vec4(1.0,0.0,1.0,1.0); | |
| } |
This file contains hidden or 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
| interface NavMesh { | |
| void NavMesh(); | |
| void destroy(); | |
| void build([Const] float[] positions, [Const] long positionCount, [Const] long[] indices, [Const] long indexCount, [Const, Ref] rcConfig config); | |
| [Value] DebugNavMesh getDebugNavMesh(); | |
| [Value] Vec3 getClosestPoint([Const, Ref] Vec3 position); | |
| [Value] Vec3 getRandomPointAround([Const, Ref] Vec3 position, float maxRadius); | |
| [Value] Vec3 moveAlong([Const, Ref] Vec3 position, [Const, Ref] Vec3 destination); | |
| dtNavMesh getNavMesh(); | |
| [Value] NavPath computePath([Const, Ref] Vec3 start, [Const, Ref] Vec3 end); |
This file contains hidden or 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
| python -m SimpleHTTPServer |
This file contains hidden or 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
| emcc helloworld.c -o helloworld.html |
This file contains hidden or 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
| #include <stdio.h> | |
| int main() | |
| { | |
| printf("Hello world from the cpp side!\n"); | |
| return 0; | |
| } |
This file contains hidden or 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
| mkdir emscripten | |
| cd emscripten | |
| git clone https://github.com/emscripten-core/emsdk.git | |
| cd emsdk | |
| emsdk install latest | |
| emsdk activate latest |