Skip to content

Better high precision projection #3

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

Merged
merged 1 commit into from
Nov 7, 2016
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
8 changes: 4 additions & 4 deletions lib/shaders/xform.glsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma glslify: export(computePosition)
vec4 computePosition(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo, vec2 screenScale, vec2 screenOffset) {
return vec4(scHi * posHi + trHi
+ scLo * posHi + trLo
+ scHi * posLo
+ scLo * posLo
return vec4((posHi + trHi) * scHi
+ (posLo + trLo) * scHi
+ (posHi + trHi) * scLo
+ (posLo + trLo) * scLo
+ screenScale * screenOffset, 0, 1);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gl-scatter2d-fancy",
"version": "1.2.0",
"version": "1.2.1",
"description": "Fancy and slow scatter plots",
"main": "scatter-fancy.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions scatter-fancy.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ var proto = GLScatterFancy.prototype

var scaleX = 2 * boundX / dataX
var scaleY = 2 * boundY / dataY
var translateX = 2 * (bounds[0] - dataBox[0]) / dataX - 1
var translateY = 2 * (bounds[1] - dataBox[1]) / dataY - 1
var translateX = (bounds[0] - dataBox[0] - 0.5 * dataX) / boundX
var translateY = (bounds[1] - dataBox[1] - 0.5 * dataY) / boundY

SCALE_HI[0] = scaleX
SCALE_LO[0] = scaleX - SCALE_HI[0]
Expand Down