Drawing lines of a block

Discussion in 'Plugin Development' started by Streammz, May 18, 2011.

Thread Status:
Not open for further replies.
  1. I am currently trying to make a method drawLine(Block pos1, Block pos2, Material material) to draw a line between these 2 points, but i can't really think of the best solution.
    It doesn't have to be flawless, as long as it looks like a line.

    Help appreciated
     
  2. Offline

    Jayjay110

    what do you mean? like select two points and place blocks in between them? if so:

    drawLine(Block p1, Block p2, Material mat){

    double x1 = p1.getX();
    double z1 = p1.getZ();
    double x2 = p2.getX();
    double z2 = p2getZ();

    double mz = (z1-z2)
    double mx = (x1-x2);
    double m = mz/mx;

    }

    Something to do with gradient idk right now lol
     
  3. Offline

    fullwall

    Do a while/for loop? It's pretty simple mathematics (y=gradient * x+c (can be worked out using simple maths)).
     
  4. Offline

    Jayjay110

    how would you actually do this? while for what or for for what?
     
  5. Offline

    fullwall

    It gets tricky, actually, because Minecraft uses the x/z axes (thus making it slightly trickier).
     
  6. Offline

    Jayjay110

  7. I actually found a better solution for this, i won't need it anymore but if you guys still want to find out how it works, go and discuss :)
    maybe some people may find a method like this useful
     
  8. Offline

    fullwall

Thread Status:
Not open for further replies.

Share This Page