0

Okay, so i created an an int array like so int position = new int[160][250][160] to represent a possition in a 3D space ([x][y][z]) what i want to do is draw a line from one point to another, but am confused about how to get a number from that array?

if i want to draw a line from point [78][89][30] to [34][75][25] how would i get a specific number from just one of those arrays? or would it be best just to create 3 seperate arrays? (keeping voxels in mind)?

Thanks - Shamus

user1610541
  • 111
  • 1
  • 11

1 Answers1

1

I would suggest to have a class 3DPoint

class Point3D{
    int x;
    int y;
    int z;
}

class Line{
    Point3D pointFrom;
    Point3D pointTo;
}

This is how you do things easily in Object Oriented World

TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57