Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

My minecraft bat problem


Recommended Posts

So let's say I have a giant bat model. It's has 5 wing membranes that are 50 X 50 pixels in size and is a perfect square since Minecraft models and modelparts only accept cubes and squares. So to make it look like a bat wing, we sculpt and erase the overlapping parts of a texturemap and shape out and texture a bat wing, the erased parts wouldn't be rendered ingame thus creating a wing. Now here's the problem, the bat would fold it's wings when hanging in caves, but when it do, the already shaped would pierce the body and overlap making weird pointy star shapes.

What I understand:

1. Get the angle by calculating the rotation of the parent model part "wingfingers" to get the overlapping parts .

2. Get the location of  the wings at the texturemap

3. Then create a smooth algorithim that would determine the overlapping parts every time it closes it's wings.

4. then once the numbers are done, erase the overlapping parts. 

 

What I don't understand:

1. Is this even possible to erase an already textured model using only code?

2. Can I even make a straight line using pixels.

Link to post
Share on other sites
8 minutes ago, Kiljaeden053 said:

It's has 5 wing membranes that are 50 X 50 pixels in size and is a perfect square since Minecraft models and modelparts only accept cubes and squares

Not true, it's just better to use ratios, widths, and heights that are a power of two.

9 minutes ago, Kiljaeden053 said:

Is this even possible to erase an already textured model using only code?

All data is sent and processed in a stream of bytes, so modifying a stream of byte data before it reaches it source is more than possible. A better answer is don't. You have a model and you can apply any texture to it within the renderer. Just use that instead of editing some other texture data. You can do some clever logic with the renderers in the model to achieve your goal with no hassle, just requires a bit of time.

13 minutes ago, Kiljaeden053 said:

Can I even make a straight line using pixels.

Why couldn't you?

Link to post
Share on other sites
4 minutes ago, ChampionAsh5357 said:

You can do some clever logic with the renderers in the model to achieve your goal with no hassle, just requires a bit of time.

 

This is what I don't like. You see I want to make it's wings large but they will always overlap the body

Quote

Can I even make a straight line using pixels.

Ok this is the result of me not getting enough sleep. What I mean is that if it's possible to even get a slant line of pixels that will later on convert into a straight line of pixels. 

My thoughts: So instead of pixel by pixel erasure. How about instead a transparency mask of sorts. the pixel is still in there,  just unseen.

Link to post
Share on other sites
1 minute ago, Kiljaeden053 said:

This is what I don't like. You see I want to make it's wings large but they will always overlap the body

 

Not being rude, that's more a result of poor animation rather than textures. If handled correctly, there should be no way to overlap the body.

4 minutes ago, Kiljaeden053 said:

My thoughts: So instead of pixel by pixel erasure. How about instead a transparency mask of sorts. the pixel is still in there,  just unseen.

This is less related to Minecraft and more taking a texture, masking by color range, using some sort of neural algorithm to determine whether the pixels represent a line or not and then editing the values to achieve the effect you want.

  • Thanks 1
Link to post
Share on other sites

 

Quote

This is less related to Minecraft and more taking a texture, masking by color range, using some sort of neural algorithm to determine whether the pixels represent a line or not and then editing the values to achieve the effect you want.

I am satisfied of your reply sir! I'll be looking for some other forums to fix this problem. Needless to say thanks for helping.

Link to post
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.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm currently trying to make a new cauldron-type block, and I'm having difficulty implementing blockstates. Here's the relevant part of the alchemical cauldron's code:   public class AlchemicalCauldronBlock extends Block { public static final IntegerProperty LEVEL = IntegerProperty.create("level", 1, 3); private static final VoxelShape INSIDE = box(2.0D, 4.0D, 2.0D, 14.0D, 16.0D, 14.0D); protected static final VoxelShape SHAPE = VoxelShapes.join(VoxelShapes.block(), VoxelShapes.or(box(0.0D, 0.0D, 4.0D, 16.0D, 3.0D, 12.0D), box(4.0D, 0.0D, 0.0D, 12.0D, 3.0D, 16.0D), box(2.0D, 0.0D, 2.0D, 14.0D, 3.0D, 14.0D), INSIDE), IBooleanFunction.ONLY_FIRST); public AlchemicalCauldronBlock() { super(Properties.of(Material.METAL).sound(SoundType.METAL).harvestLevel(3).strength(2F,2F)); // this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, 0)); // this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0))); } ... When I try to run this with either of the two attempts at registerDefaultState uncommented, I get this error: https://pastebin.com/vPf3UryC. For convenience, I believe this part is most relevant: How can I avoid this? My registry classes look like this, if it helps: public class registry { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, AlchemyPlus.MODID); public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, AlchemyPlus.MODID); public static void register() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); BLOCKS.register(modEventBus); ITEMS.register(modEventBus); registerItems.register(); registerBlocks.register(); } } public class registerBlocks { public static final RegistryObject<Block> ALCHEMICAL_CAULDRON = register("alchemical_cauldron", AlchemicalCauldronBlock::new); static void register() {} private static <T extends Block> RegistryObject<T> registerNoItem(String name, Supplier<T> block) { return registry.BLOCKS.register(name, block); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<T> block) { RegistryObject<T> ret = registerNoItem(name, block); registry.ITEMS.register(name, () -> new BlockItem(ret.get(), new Item.Properties().tab(ItemGroup.TAB_BREWING))); return ret; } } Full GitHub repository available here.   (Other minor problem(?):  I copied the methods getShape and getInteractionShape from net.minecraft.block.CauldronBlock and I'm getting these weird warnings. What's up with that? Do I need to worry about it?)  
    • Personally I use IForgeRegistryEntry#getRegistryName and then ResourceLocation#getNameSpace to get the id of the object.
    • you can get a block form a ResourceLocation, take a look at NBTUtil#readBlockState, do somthing like that
    • I am running forge version 1.16.5 36.1.31 on a server with a lot of mods and when a player refreshes the server list, it sends a long error in the server console. Additionally, the server list displays "Can't connect to server", despite refreshing and actually being able to connect to the server. here's the links to the logs: https://gist.github.com/WaffleTraits/83885b1539d5711fabff73a91924e665 https://gist.github.com/WaffleTraits/5ae78e6eaa330422bbc9f7226faf60ce Here's what's displayed in console when a player refreshes server listing: https://hastebin.com/ativexeyoy.properties server is running on ubuntu 20.04 and is using java 8 for this forge instance.
    • I kept getting this error whenever I tried joining my modded server I want to find a solution to this I checked every mod and it all matched Client : https://mclo.gs/Q39SSu5 server : https://mclo.gs/UO2kbDz
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.