summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-03-31 17:36:00 -0500
committersanine <sanine.not@pm.me>2023-03-31 17:36:00 -0500
commit0587c63c26e94d26700a11bc2a9459f82f043a9c (patch)
treefa6938521d41659ca6e1877cda11c5395e97ceed /src
parent673e9c13aea6cd1b11f5ca3e1f6edd474bbb1a19 (diff)
fix bug with stray stroke
Diffstat (limited to 'src')
-rw-r--r--src/MapView.js5
-rw-r--r--src/main.js7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/MapView.js b/src/MapView.js
index a08d6b7..44191b0 100644
--- a/src/MapView.js
+++ b/src/MapView.js
@@ -45,6 +45,7 @@ export class MapGrid {
console.log(angle);
const point = new Point(radians(angle), 0).normal();
const axis = point.cross(yAxis).normalize();
+ console.log(axis);
this.longitudes.push(Circle(
point, axis, circleDiv
));
@@ -52,6 +53,10 @@ export class MapGrid {
}
render(ct, view) {
+ ct.beginPath();
+ ct.arc(0, 0, 1, 0, 2*Math.PI);
+ ct.stroke();
+
for (let latitude of this.latitudes) {
latitude.render(ct, view);
}
diff --git a/src/main.js b/src/main.js
index a86a38e..f1d3635 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,9 +11,10 @@ window.onload = () => {
const yaxis = new Vec3(0, 1, 0);
const zaxis = new Vec3(0, 0, 1);
- const grid = new MapGrid(30, 90);
+ const grid = new MapGrid(30, 30);
+ console.log(grid)
- let view = new Mat3();
+ let view = new Mat3().rotation(xaxis, -0.3*Math.PI);
let angle = 0;
canvas.onDraw = ct => {
@@ -22,8 +23,6 @@ window.onload = () => {
ct.lineWidth = 0.005;
ct.strokeStyle = "#E7305D";
ct.fillStyle = "blue";
- ct.arc(0, 0, 1, 0, 2*Math.PI);
- ct.stroke();
grid.render(ct, view);
};