Giter Site home page Giter Site logo

Why the need to reverse the map? about amaze HOT 4 OPEN

icza avatar icza commented on July 17, 2024
Why the need to reverse the map?

from amaze.

Comments (4)

sproket avatar sproket commented on July 17, 2024 1

I see. Thanks. OK I'll make a point of referencing your gihub page when I make my game public. :)

from amaze.

icza avatar icza commented on July 17, 2024

I wrote the code a very long time ago, can you point out exactly where this is?

from amaze.

sproket avatar sproket commented on July 17, 2024

Yeah it's the Level.generateMap method you added the comment // Reverse the list so the row index will grow as the z index

I'm not sure what that means. Is it because this is the way JavaFX expects the objects to be added? I tried reversing the for loops and I didn't see any difference. Or could it be because of the Perspective Camera orientation?

Thanks for replying BTW. This this is very nice sample on how to make a 3D maze. In my case, I don't only use Blocks. I also use other object types which need the correct orientation.

from amaze.

icza avatar icza commented on July 17, 2024

I think the answer simply is because the map is saved as a 2D matrix in the map data files, and naturally the row index starts at 0, at the top left corner, and increases downward (like pixel coordinates on the screen). But if we reverse the lines and face "upward" on the plane of the map, then increasing row index will correspond to increasing z coordinate.

I don't think this has much significance, this might have just been more natural to me, and might result in somewhat easier calculations. Does not have a big impact.

from amaze.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.