2

I'm trying to make a something for an orbit dynamics using three.js.

I want to draw a area in 3D world using some points. The points are of type Vector3, e.g. [1, 2, 3]. They all lie on the same plane. enter image description here

Here is an image of my problem.

//I know THREE.Shape can take an array of Vector2 points to form a shape, but how can I do this with a set of Vector3 points?

Demian Oh
  • 21
  • 2
  • How many points will there be? Are they on a single plane? – Tennyson H Feb 23 '16 at 16:48
  • um.. minimum 1000. yes, this points has single plane. – Demian Oh Feb 23 '16 at 16:54
  • Have you taken a look at this demo? It seems to be exactly what you need. http://threejs.org/examples/#webgl_geometry_shapes You can try to follow this demo and if you have problems, edit your question and it'll be bumped to the top again. Here is the source code for that demo: https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_shapes.html – Tennyson H Feb 23 '16 at 17:05
  • I've already tried. but i have problem yet. points that i use is [x, y, z]. but this example is using only [x, y] and position.set(). easy to say, my points is [1, 2, 3], [2, -3, 5], [5, 2, -1] ... but this example is [1, 2, 50], [2, -3, 50], [5, 2, 50] ... I'm sorry for my English skill... – Demian Oh Feb 23 '16 at 17:39
  • Your English is very good! Ok, so your points are Vector3 type. `THREE.Shape` relies on the points being Vector2, so you will need to convert your points to Vector2. I am rusty on my math, but since your points are on a plane, it should be easy to cast your Vector3 points onto their intersecting plane and come out with a Vector2. Here is a stack exchange question about performing this operation. You might have better results asking this as a new question here with the three.js tag https://stackoverflow.com/questions/23472048/projecting-3d-points-to-2d-plane – Tennyson H Feb 23 '16 at 17:47
  • Actually, The points that i know is orbital position vectors that consist of one orbit. and I want to draw a "orbital plane" of this points. like this [link](https://en.wikipedia.org/wiki/Orbital_node#/media/File:Planet_orbit_nodes_2_animation.gif). Are this problem solved by using projection? I don't understand well... – Demian Oh Feb 24 '16 at 03:59
  • @DemianOh okay, I think I understand a bit better. You have the orbital vectors `r` and `v` from this diagram https://en.wikipedia.org/wiki/Orbital_state_vectors#/media/File:Orbital_state_vectors.png and you are looking to draw the orbital plane? – Tennyson H Feb 24 '16 at 17:24
  • Side note, this simulation seems worth studying. It appears to do the behavior you describe, and it is in three.js : https://mgvez.github.io/jsorrery/ – Tennyson H Feb 24 '16 at 17:27
  • Exactly. Simulator that i try to make is very similar this linked address. I will refer this site! – Demian Oh Feb 25 '16 at 13:07

0 Answers0