Skip to content

Commit

Permalink
- Over Under video is now OK (top=left eye, bottom=right eye)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarinmiro committed Nov 5, 2016
1 parent a47cb74 commit 6db3472
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 14 deletions.
18 changes: 14 additions & 4 deletions dist/aframe-stereo-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
}
}
}
Expand All @@ -157,9 +163,13 @@
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;

if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/aframe-stereo-component.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions examples/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ module.exports = {
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
}
}
}
Expand All @@ -94,9 +100,13 @@ module.exports = {
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;

if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
}
}
}
}
Expand Down
18 changes: 14 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ module.exports = {
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
}
}
}
Expand All @@ -83,9 +89,13 @@ module.exports = {
var axis = this.data.split === "vertical" ? "y" : "x";
for (var i = 0; i < uvs.length; i++) {
for (var j = 0; j < 3; j++) {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;

if (axis == "x") {
uvs[ i ][ j ][ axis ] *= 0.5;
uvs[ i ][ j ][ axis ] += 0.5;
}
else {
uvs[ i ][ j ][ axis ] *= 0.5;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aframe-stereo-component",
"version": "0.3.0",
"version": "0.3.1",
"description": "Stereoscopic component for A-Frame VR.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 6db3472

Please sign in to comment.