Im creating a city building game, and i need to check if the building is 100% inside the grid, which is currently a 3d cube (using only the X and Z coordinates of the building) i thought to take the maximum coordinates of the cube and calculate it with the construction coordinates (like the example below) in a autmotatic way that i dont need to do this for every single construction. But i dont know if this will work and i dont know how to do this. Some help ?

enter image description here

  • 1
    \$\begingroup\$ If your boxes are axis-aligned, then comparing their minimum and maximum values on each axis sounds like a good solution. How have you tried to put this idea into practice, and where did you get stuck? \$\endgroup\$
    – DMGregory
    Sep 18 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.