Jump to content

ModelBase coordinate system


horsewithnoname

Recommended Posts

Hello there!

 

Background: I've been working on code for intergrading custom models into minecraft described in JSON format. Before that I've been writing models using ModelRenderers.

 

Before I could using custom models described in JSON, I used to write every box in ModelRenderer format, and then I had to check if the texture mapping is correct and is coordinates are fine too by running minecraft again and again. The problem was in the coordinate system.

 

Why the hell is ModelBase's coordinate system is so f*ck*d up?! Well, X and Z axes are kinda fine, but the Y axis is messed up completely! Why Y=0.0 isn't the bottom of the model, and instead it's something like 16 pixels (as I understand 16 pixels = 1 block (0.0625F))? That's not cool.

 

Why did Mojang/Notch choose that kind of origin for models?

 

P.S.: Is that the right forum for discussions?

Blockbuster – simple machinimas and cinematics for Minecraft
Link to comment
Share on other sites

Y axis is fine, take an example from the cube.json file:

 

{

    "parent": "block/block",

    "elements": [

        {  "from": [ 0, 0, 0 ],

            "to": [ 16, 16, 16 ],

            "faces": {

                "down":  { "texture": "#down", "cullface": "down" },

                "up":    { "texture": "#up", "cullface": "up" },

                "north": { "texture": "#north", "cullface": "north" },

                "south": { "texture": "#south", "cullface": "south" },

                "west":  { "texture": "#west", "cullface": "west" },

                "east":  { "texture": "#east", "cullface": "east" }

            }

        }

    ]

}

 

On the Y axis (in green) we can see that the block is going from y=0 to y=16

So I conclude that 0 is the bottom and 16 is the top of a typical minecraft block.

Link to comment
Share on other sites

Y axis is fine, take an example from the cube.json file:

 

{

    "parent": "block/block",

    "elements": [

        {  "from": [ 0, 0, 0 ],

            "to": [ 16, 16, 16 ],

            "faces": {

                "down":  { "texture": "#down", "cullface": "down" },

                "up":    { "texture": "#up", "cullface": "up" },

                "north": { "texture": "#north", "cullface": "north" },

                "south": { "texture": "#south", "cullface": "south" },

                "west":  { "texture": "#west", "cullface": "west" },

                "east":  { "texture": "#east", "cullface": "east" }

            }

        }

    ]

}

 

On the Y axis (in green) we can see that the block is going from y=0 to y=16

So I conclude that 0 is the bottom and 16 is the top of a typical minecraft block.

 

I'm talking about ModelBase coordinate system, i.e. the one that Render<?> and entities use.

Blockbuster – simple machinimas and cinematics for Minecraft
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.