GenMeshCubicmap() parameter description

Hello all,

While trying to reaquaint myself with OpenGL, I came across your library. Raylib seems like a very good place to start!

While looking into the models module, I noticed that LoadCubicmap() calls GenMeshCubicmap with a second parameter (Vector3 cubeSize). I'm curious what the interpretation of this parameter is. It's clear that cubeSize.y specifies the wall height, but I'm not so sure about the other two members (x & z). Common sense tells me that they are the width and breadth of a single map cell.

Is my intuition correct, or am I way off?



  • Hello! Welcome to raylib forum! :smile:

    Yes, you're right, x and z sizes refer to a single cube of the cubicmap mesh.

    Just as a detail, notice that generated mesh only includes visible faces of the cubicmap, it's optimized on creation.
  • Hello raysan!

    Unfortunately there's a bug that renders an incorrect cubicmap when the cube parameters (x & z) are not 1.0f.

    I think I've fixed it on my local copy of raylib. Shall I create a pull request?
  • Hi!

    Fixes are always welcome! Just make sure to sync to latest develop branch and PR to develop branch.

    Thank you very much for detecting the issue! :D
Sign In or Register to comment.