From 54363d2e52992ea45f1c58b0182e842f3ac7a465 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 22 Apr 2015 14:33:40 +0200 Subject: [PATCH] Modified arrows --- index.py | 2 ++ js/FixedCamera.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/index.py b/index.py index 7257e93..7b0dfda 100755 --- a/index.py +++ b/index.py @@ -5,3 +5,5 @@ import sys from webtools import Web Web.render('index.html') + +print('download') diff --git a/js/FixedCamera.js b/js/FixedCamera.js index b9077a2..a4a3047 100644 --- a/js/FixedCamera.js +++ b/js/FixedCamera.js @@ -142,7 +142,9 @@ FixedCamera.prototype.update = function(mainCamera) { FixedCamera.prototype.regenerateArrow = function(mainCamera) { var vertices = new Array(); var t = [0,1]; - var f = [mainCamera.position.clone(), this.position.clone()]; + var f0 = mainCamera.position.clone(); + f0.add(Tools.sum(Tools.mul(this.up,-1), Tools.diff(this.target, this.position).normalize())); + var f = [Tools.sum(mainCamera.position, Tools.diff(this.target, this.position)).normalize(), this.position.clone()]; var first = Tools.diff(mainCamera.target, mainCamera.position); first.normalize(); @@ -150,12 +152,12 @@ FixedCamera.prototype.regenerateArrow = function(mainCamera) { var fp = [Tools.mul(first,40), Tools.diff(this.target, this.position)]; fp[1].normalize(); fp[1].multiplyScalar(4); - var hermite = new Hermite.special.Polynom(f[0], f[1], fp[1]); + var hermite = new Hermite.special.Polynom(f0, f[1], fp[1]); var up = this.up.clone(); var point; var deriv; - var limit = this.fullArrow ? 0.1 : 0.3; + var limit = this.fullArrow ? 0.1 : 0.2; // for (var i = this.fullArrow ? 0 : 0.5; i <= 1.001; i += 0.05) { for (var i = 1; i > limit; i -= 0.01) {