Skip to content
Snippets Groups Projects
Commit 4896d41a authored by Xavier Gibert's avatar Xavier Gibert
Browse files

added second ref line to spherical coordinates

parent ea918f79
No related branches found
No related tags found
No related merge requests found
......@@ -16,3 +16,4 @@
/assets/www/modules/angles.js~
/assets/www/modules/earth.js~
/assets/www/modules/sun.js~
/assets/www/modules/view.js~
......@@ -75,7 +75,7 @@ This three.js demo is part of a collection at
//var keyboard = new THREEx.KeyboardState();
var clock = new THREE.Clock();
var spacecraft, arrow_vel, arrow_accel, arrow_momentum, target_a, vector_a, direction_a;
var long_arc, lat_arc, long_sprite, lat_sprite, lineAngle, lineSpheric;
var long_arc, lat_arc, long_sprite, lat_sprite, lineAngle, lineSpheric, lineSpheric2;
var vectors_arc, vectors_sprite;
var origin = new THREE.Vector3(0,0,0);
......
......@@ -90,6 +90,14 @@ function initAngles(){
var lineMaterial = new THREE.LineDashedMaterial( { color: arc_color, dashSize: 1, gapSize: 3 } );
lineSpheric = new THREE.Line( lineGeometry, lineMaterial );
scene.add(lineSpheric);
//Set discontinued lines
var lineGeometry = new THREE.Geometry();
var vertArray = lineGeometry.vertices;
vertArray.push( sphcoord_cross.clone(), new THREE.Vector3(0, 0, 0) );
lineGeometry.computeLineDistances();
var lineMaterial = new THREE.LineDashedMaterial( { color: arc_color, dashSize: 1, gapSize: 3 } );
lineSpheric2 = new THREE.Line( lineGeometry, lineMaterial );
scene.add(lineSpheric2);
//create longitude arc
......@@ -281,6 +289,10 @@ function updateAngles(){
lineSpheric.geometry.computeLineDistances();
lineSpheric.geometry.verticesNeedUpdate = true;
lineSpheric2.geometry.vertices[0].set(sphcoord_cross.x,sphcoord_cross.y,sphcoord_cross.z);
lineSpheric2.geometry.computeLineDistances();
lineSpheric2.geometry.verticesNeedUpdate = true;
//update longitude arc
scene.remove( long_arc );
var spline = new THREE.QuadraticBezierCurve3(sphcoord_cross.clone(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment