Skip to content

Commit cbb42bc

Browse files
author
Carlos Martin
committedApr 15, 2016
Added rendering of hemisphere for testing
1 parent 10ca242 commit cbb42bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎spherical-pixelwise/spherical.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ function render_pixel()
4545
var point_y = frame_point.y * normal_component + tangent.y / length * tangential_component;
4646
var point_z = frame_point.z * normal_component + tangent.z / length * tangential_component;
4747

48-
var angle = Math.acos(Math.abs(point_x * disc.x + point_y * disc.y + point_z * disc.z));
4948

49+
50+
var angle = Math.acos(Math.abs(point_x * disc.x + point_y * disc.y + point_z * disc.z));
5051
if (angle < disc_radius)
5152
{
5253
//data[index++] = 255;
@@ -57,7 +58,14 @@ function render_pixel()
5758
{
5859
data[index++] = 0; // red
5960
}
60-
data[index++] = 0; // green
61+
if (point_x > 0)
62+
{
63+
data[index++] = 30; // green
64+
}
65+
else
66+
{
67+
data[index++] = 0;
68+
}
6169
data[index++] = 0; // blue
6270
data[index++] = 255;
6371
}

0 commit comments

Comments
 (0)
Please sign in to comment.