Skip to content

Rotate Custom Baked Model #1975

Discussion options

You must be logged in to vote

My friend and I spent the last few hours scouring the source code, and developed a solution that uses a QuadTransform to rotate a custom baked model according to a direction. Here's a few snippets for whoever wants to recreate this effect in the future - hopefully with a bit less pain and maths than we went through.


"Attempt No. 37" ~ 2022, colourised

Implementing the transform:

@Override
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
    if (state.contains(HorizontalFacingBlock.FACING)) context.pushTransform(new RotateToFacing(state.get(HorizontalFacingBlock.FACING)));
    // Model is emitte…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Anemony22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant