3D wayponts with real distances and real height in order to simulate a flight pattern

edited June 2017 in Library Questions

I'm a rookie programmer , I'm trying to develop a tool with processing that receive in input a series of 3D waypoint (distance, range and angle) and than connect all this point and draw the 3D flight patten (wayponint with geodata and interpolation lines that connects all togethar). I tryed to use PROSCENE lib. with poor results (but is due to my low skill), but I fell that there should be an easy way. Can someone give me some hints or a reference code to work with? thanks a lot. Petrix

Answers

  • it's usually better to post what you have so that we don't have to start from nothing

    even if it's only the data.

  • Keep in mind that PVector has a dist() method, and that line() takes 3 arguments.

    For geodata ( if I'm understanding right ) you might want to consider unfoldingmaps plus altitude data. It really depends on what you are trying to accomplish.

  • distance, range and angle

    What is a distance and a range? And the angle, is that with respect to some reference point? I am thinking you would need at least two angles, phi and theta.

    You should explore @Chrisir's version of LOGO. It might work if you translate your data into data points that his code could process: https://forum.processing.org/two/discussion/comment/93370/#Comment_93370
    I don't think it will work right out of the box but it could be a starting point. You should explore his video tutorial and evaluate if you could use it for your challenge.

    Kf

  • Ypu right, I wrote in incorrect way - It is as you say - range, elevation and beraring (azimuth). I need it all North referenced. thanks to all, I've got a preliminary scketch, soon I'll submit it. G

  • I do not understand why I cant display within a simple routine this 3 boxes, while if they are ouside all is OK, see please my code:

    ////////// file data positions.txt (in data folder) is this

    10 10 10 50 40 10 20 30 30

    //////////////////////// this is code:

    import remixlab.proscene.*; import remixlab.dandelion.geom.*;

    // set data String[] lines; int index, inc = 0;

    Scene scene; Point screenPoint = new Point();

    void setup() { size(640, 320, P3D); scene = new Scene(this); }

    void draw() {
    background(0);
    // read data from TXT file (3 data x,y,z per row separeted by tab lines = loadStrings("positions.txt"); index = lines.length; float[] x = new float[index]; float[] y = new float[index]; float[] z = new float[index]; if (inc < index) { String[] pieces = split(lines[inc], '\t'); if (pieces.length == 3) { x[inc] = float(pieces[0]); y[inc] = float(pieces[1]); z[inc] = float(pieces[2]); pushMatrix(); translate (x[inc], y[inc], z[inc]); box (10); popMatrix(); inc = inc + 1; } } }

Sign In or Register to comment.