Jump to content

How can i rotate models around z axis in blockstates?


Drachenbauer

Recommended Posts

Hello

I´m working on a mod, that makes the pumpkin and melon blocks laying on the side, as long as they are attached to their stems.

I noticed, that the stem goes to the middle of the vertical side of the block, but the texture with the "stem-dot" in the center is ontop of the model.

That looks not very realistic

 

The java-stuff is ready.

i made extra block classes for the attached melon and pumpkin, to have blockstates (unable to add them to the vanilla-ones for overriding them)

 

But now i have a problem with their blockstates:

If they grow to the north or south, they look fine, with rotating the existing melon and pumpkin models around x (the stem goes exact to the rght spot).

But, if they grow to the east or west, i find no way to rotate the model in theese directions (rotate z does not exist).

I tried rotating x and y, but they appear only x rotated (identical to the north and south ones).

 

How can i rotate the east and west variants in the blockstates correctly?

I don´t want to make a new model extra fot this.

 

My actual blockstate-json:

{
    "variants":
    {
        "facing=north": { "model": "block/melon", "x": 270 },
        "facing=east": { "model": "block/melon", "x": 270, "Y" : 90 },
        "facing=south": { "model": "block/melon", "x": 90 },
        "facing=west": { "model": "block/melon", "x": 90, "Y" : 90 }
    }
}

 

For the pumpkin the same, just with "pumpkin" instead of "melon" in the four lines.

Edited by Drachenbauer
Link to comment
Share on other sites

You don't. You use a combination of X rotation and Y rotation.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

17 hours ago, Drachenbauer said:

"Y"

is not

"y"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

...what font are you using...no, I don't want to know. That's your problem to deal with. Use a better font.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • 10 months later...

I am new to modding and facing similar issue.  What I realized is that since Z axis rotation is not supported, using combination of X and Y does not always work.  I think the Block State JSON file always apply X-axis rotation first before Y-axis rotation, but I needed Y-axis to be rotated first before X-axis rotation to get to the texture face I need.  Is this a bug or an intended behavior? Am I missing something?

Link to comment
Share on other sites

The game does not recognize a Z axis for rotation because the game world does not distinguish between "north/south" and "east/west" as being unique for the purpose of rendering things (that is, models should be compass orientation agnostic).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • 3 years later...

Okay, but the idea that models should be compass orientation agnostic has nothing to do with the fact that it is, in some cases, impossible to achieve certain block orientations through only rotations about the x and y axes.  You also cannot change the order of the x and y rotations which further limits the number of achievable rotation states.  For instance, a maximally orientable block, something like a dice block, has 24 possible orientation states.  (You can point the 1 face in any direction, of which there are six, and then point the 2 in any perpendicular direction to that, of which there are four, these two choices uniquely determine the locations of all remaining faces, so since 6x4=24, there are 24 possible orientations.)  However, the minecraft blockstate rotation system only has sixteen possible rotation values.  4 x axis rotations (0, 90, 180, 270), followed by 4 y axis rotations.  4x4=16.  So, since 16 is less than 24, it can't be the case that all possible orientations of the dice block are achievable with only x and y rotations.  Some other kinds of rotation would be required to achieve these orientations.  For instance, rotation about the z axis.

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.



×
×
  • Create New...

Important Information

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