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

Features , can-be-compiled, can-use-es2017, can-be-served #2

Merged
merged 13 commits into from
Aug 6, 2017
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/index.bundle.js
1 change: 1 addition & 0 deletions .gitigore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/index.bundle.js
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ A websperience by Vi Hart, Andrea Hawksley, and Henry Segerman, using the hyperb

Try it at: https://hawksley.github.io/hypVR/


## Installing Locally

The version 1.1.0 requires node.js version > 6 and should work with every os.

### Steps:
- git clone this project
- run "npm install" where you cloned this project
- run "npm start"

you should see the application run on http://localhost:8080
Enjoy.

### Release Notes:
1.1.0:
- The application can be compiled with webpack to reduce dramatically the file size of the imported code
- Less pollution of the global scope
- using webVR polyfill, the application runs on browsers
- the package host it own dev server to compile the code as each file save
- the dev server can be run from an npm command

### Further Enhancements:
- finishing polishing the code to make it more granular and easy to modify
- introducing performance testing for big functions like gramShmidt
- introducing unit tests

## Links
- http://vihart.com
- http://andreahawksley.com
Expand All @@ -15,3 +41,4 @@ Try it at: https://hawksley.github.io/hypVR/
- http://www.geometrygames.org/CurvedSpaces/
- http://www.marctenbosch.com
- https://github.com/MozVR/vr-web-examples/tree/master/threejs-vr-boilerplate
- https://github.com/AbdoulSy
File renamed without changes.
64 changes: 34 additions & 30 deletions index.html → dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@

<body></body>

<!-- This entire block in only to facilitate dynamically enabling and
disabling the WebVR polyfill, and is not necessary for most WebVR apps.
If you want to use the polyfill in your app, just include the js file and
everything will work the way you want it to by default. -->
<script>
var WebVRConfig = {
// Prevents the polyfill from initializing automatically.
DEFER_INITIALIZATION: true,
FORCE_ENABLE_VR: true,
// Ensures the polyfill is always active when initialized, even if the
// native API is available. This is probably NOT what most pages want.
ALWAYS_APPEND_POLYFILL_DISPLAY: true,
}
</script>
<script src="js/third-party/webvr-polyfill.js"></script>
<script src="js/third-party/wglu/wglu-url.js"></script>
<script>
// Dynamically turn the polyfill on if requested by the query args.
if (WGLUUrl.getBool('polyfill', false)) {
InitializeWebVRPolyfill();
} else {
// Shim for migration from older version of WebVR. Shouldn't be necessary for very long.
InstallWebVRSpecShim();
}
</script>

<script type="x-shader/x-vertex" id="vertexShader">
// This shader moves vertices around

Expand All @@ -45,8 +71,8 @@
uniform mat4 translation; // dodecahedral
uniform mat4 boost;
// uniform vec3 cellColor;
uniform vec4 cellColorQuat;
uniform vec4 userCellColorQuat;
uniform vec4 cellColorQuat;
uniform vec4 userCellColorQuat;

vec3 ChooseColor( in vec3 nBase )
{
Expand Down Expand Up @@ -138,7 +164,7 @@
float norm = sqrt(r*r+g*g+b*b);
r /= norm;
g /= norm;
b /= norm;
b /= norm;
return vec3(r*0.5 + 0.5,g*0.5 + 0.5,b*0.5 + 0.5);
}

Expand Down Expand Up @@ -222,32 +248,10 @@
}
</script>

<!--
three.js 3d library
-->
<script src="js/lib/three.min.js"></script>

<script src="js/hypMath.js"></script>
<!--
VRControlsHyperbolic.js acquires positional information from connected VR devices and applies the transformations to a three.js camera object. Also deals with hyperbolic and parabolic motions.
-->
<script src="js/vr/PhoneVR.js"></script>
<script src="js/vr/VRControlsHyperbolic.js"></script>

<!--
VREffect.js handles stereo camera setup and rendering.
-->
<script src="js/vr/VREffect.js"></script>

<script src="js/loaders/OBJLoader.js"></script>
<!--
dodec_no_id.js stores hyperbolic translation matrices to make copies of the dodecahedron.
-->
<script src="js/436.js"></script>
<!--
<script src="js/534Reflect.js"></script>
-->

<script src="js/hypTiling.js" type="text/javascript" id="mainCode"></script>

<!--
Bundled App (Concatenated and Minified)
Libraries, dependencies and Main code
-->
<script src="./index.bundle.js" id="mainCode"></script>
</html>
Loading