Jump to content

Model Animations [UNSOLVED] [1.7.10]


TheEpicTekkit

Recommended Posts

Hello everyone.

 

I would like to animate a part of a model I have for a block, and I don't know how I can do this. I know I can use GL11, but I only want it to affect one part of the model, instead, it seems to affect all of the model, or be really glitchy and flicker.

 

What I am trying to do is animate the open and close motion for the door on my block when the player opens the gui. So, I don't want something that is simple and just it immediately swings open, and suddenly stops, and the same with closing, I want there to be some acceleration and deceleration to it.

 

Now, is it possible to load a model from a program like Maya, Cinema 4D or Blender, and load any animations on the model too? If not, I'll just use GL11 to animate it, but I need to know how to properly animate an individual part of the model.

 

Also, if this is relevant information, I am using a techne model.

 

Thanks.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

Well, you just have to use Java to control the animation.  You already have a render() function I assume and you will just need some variable to keep track of the progress of the animation and change that into rotation (or whatever you need for the animation).  So when the GUI opens you might set a counter to 40 (for two seconds) and then count it down each time you render.  In the render you'd have an array with the rotation angle you want per tick, and the index would be this counter.  Then just use GL11 to rotate by the amount you need.

 

Does that make sense?  Have an array of rotation angles and step through it with a counter to create the animation duration over time.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

This is what I have already tried.

 

int maxAngle = 90;

for (int angle = 0; angle < maxAngle; angle++) {
        GL11.glRotatef(angle, 0, 1, 0); //rotate on the Y axis.
        model.Door.rotateAngleY = angle; //Apparently 90 degrees for this is 1.5F, dont know why, but I had to do some maths to get angle as close to that as possible.
        //I have tried both of these methods (not at the same time) and neither of them worked.
}

 

Now, I have noticed the setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)... method in the model class, but how do I use it? what are the parameters? I do know that this is what is used to animate players and mobs.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

Would this work?

 


public float lidAngle;

        //irrelevant code here...

        @Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {

	if (tileEntity instanceof TileEntityFuseBox) {

		//System.out.println(tileEntity.xCoord + ", " + tileEntity.yCoord + ", " + tileEntity.zCoord); //Debugging
		this.fuseBox = (TileEntityFuseBox)tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);

		if (this.fuseBox.isOpen && this.lidAngle < 90 && this.fuseBox.openingTime != 0) { //If the lid isn't open, but the gui is
			this.fuseBox.openingTime--;
			this.lidAngle += 2.25F;
		} if (!this.fuseBox.isOpen && this.lidAngle > 0 && this.fuseBox.openingTime != 20) { //If the lid is open but the gui isn't
			this.fuseBox.openingTime++;
			this.lidAngle -= 2.25F;
		}

		if (this.lidAngle < 0) this.lidAngle = 0;
		if (this.lidAngle > 90) this.lidAngle = 90;

		doRender = true;
		int meta = tileEntity.getBlockMetadata();
		if (doRender) {
			GL11.glPushMatrix();
			GL11.glTranslatef((float)x, (float)y, (float)z);
			Minecraft.getMinecraft().renderEngine.bindTexture(texture);
			this.renderModelBasedOnMeta(meta); //This has all the render info about my model.
			GL11.glPopMatrix();
		}
	}
}

        //RenderModelBasedOnMeta() method here (really big as 12 possible metadatas, and an if statement for each)

        public void renderLid() {
	this.model.Door.rotateAngleY = this.lidAngle;
}

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Problem was in specific method in Screen (version 1.20.4) protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T arg) { this.renderables.add((Renderable)arg); return this.addWidget(arg); } I assume because of these multi-inheritance interfaces. After rewriting it in the fields, everything worked. Final working code: @Shadow @Final public List<Renderable> renderables; @Shadow @Final private List<GuiEventListener> children; @Shadow @Final private List<NarratableEntry> narratables; public void custom$addRenderableWidget(AbstractWidget widget) { renderables.add(widget); children.add(widget); narratables.add(widget); }  
    • hey, I'm trying to make a server with mods and it's not working. when I run it without mods, it works normally Log:[27maj2024 17:53:12.540] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 40.2.0, --fml.mcVersion, 1.18.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220404.173914] [27maj2024 17:53:12.544] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 9.1.3+9.1.3+main.9b69c82a starting: java version 22.0.1 by Oracle Corporation [27maj2024 17:53:12.660] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/kamil/Desktop/server/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2314!/ Service=ModLauncher Env=SERVER [27maj2024 17:53:13.006] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\kamil\Desktop\server\libraries\net\minecraftforge\fmlcore\1.18.2-40.2.0\fmlcore-1.18.2-40.2.0.jar is missing mods.toml file [27maj2024 17:53:13.010] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\kamil\Desktop\server\libraries\net\minecraftforge\javafmllanguage\1.18.2-40.2.0\javafmllanguage-1.18.2-40.2.0.jar is missing mods.toml file [27maj2024 17:53:13.013] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\kamil\Desktop\server\libraries\net\minecraftforge\lowcodelanguage\1.18.2-40.2.0\lowcodelanguage-1.18.2-40.2.0.jar is missing mods.toml file [27maj2024 17:53:13.015] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\kamil\Desktop\server\libraries\net\minecraftforge\mclanguage\1.18.2-40.2.0\mclanguage-1.18.2-40.2.0.jar is missing mods.toml file [27maj2024 17:53:13.101] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: No dependencies to load found. Skipping! [27maj2024 17:53:15.035] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [27maj2024 17:53:15.075] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeserver' with arguments [] [27maj2024 17:53:15.139] [main/WARN] [mixin/]: Reference map 'bloodmagic.refmap.json' for bloodmagic.mixins.json could not be read. If this is a development environment you can ignore this message [27maj2024 17:53:15.415] [main/WARN] [mixin/]: Error loading class: net/minecraft/world/item/ItemStack (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.416] [main/WARN] [mixin/]: @Mixin target net.minecraft.world.item.ItemStack was not found placebo.mixins.json:ItemStackMixin [27maj2024 17:53:15.439] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.447] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.449] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.456] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.457] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.461] [main/WARN] [mixin/]: Error loading class: java/util/Map$Entry (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.461] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.463] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:15.463] [main/WARN] [mixin/]: Error loading class: java/lang/invoke/MethodHandles$Lookup (java.lang.IllegalArgumentException: Unsupported class file major version 66) [27maj2024 17:53:16.436] [main/WARN] [mixin/]: Error loading class: java/lang/Boolean (java.lang.IllegalArgumentException: Unsupported class file major version 66) Mods:https://ibb.co/xj5qHYK
    • How did you manage to get it working?
    • Hi Everyone! I was playing in modded singleplayer, and suddenly mobs stopped moving, I couldn't hit them, basically I could do things but nothing happened, like destroying blocks didn't drop it, things like that. When I tried to quit and save my world, it was just writing Saving World but nothing happened, and eventually I always had to restart my computer to stop minecraft. Can someone please help me find out what could cause the issue? Here is my debug log: https://pastebin.com/X9F0M9sq This is not the complete debug log, I was pasting the last couple of hundreds of rows because of the size. In case it's needed, I will repaste rows earlier. Thank you very much in advance!  
    • As stated in the Title, I can't download forge for minecraft 1.20.06. When I click on the install button i get the AD wall, but after 10 seconds i don't get the red button to install forge.  This problem also implies the older versions of Forge I also don't see any ads on the site. Does anybode know what to do?  
  • Topics

×
×
  • Create New...

Important Information

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