Jump to content

rotating model?


memcallen

Recommended Posts

I have already created this topic (sorry). but I have ran into another problem, my model was working correctly but now the rotating parts don't render, I used to be able to render only one rotating part but now they don't render at all. can someone please point me in the right direction?

 

render of model without rotation:

pCk1H4Q.png

render of model with rotation:

pHaCaWW.png

code for model class:

package com.example.gammacraft.models;

import com.example.gammacraft.TileEntity.MiniJetTileEntity;

import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;

public class ModelMiniJet extends ModelBase
{
  //fields
    ModelRenderer base;
    ModelRenderer layer145;
    ModelRenderer layer190;
    ModelRenderer Shape1;
    ModelRenderer layer1452;
    ModelRenderer layer1902;
    ModelRenderer Blade1;
    ModelRenderer Blade2;
    ModelRenderer Blade3;
    ModelRenderer Blade_4;
    
  public ModelMiniJet()
  {
    textureWidth = 64;
    textureHeight = 32;
    
    
      //base
      base = new ModelRenderer(this, 0, 0);
      base.addBox(0F, 0F, 0F, 16, 1, 16);
      base.setRotationPoint(-8F, -1F, -8F);
      base.setTextureSize(64, 32);
      base.mirror = true;
      setRotation(base, 0F, 0F, 0F);
      
      //layer 1
      layer145 = new ModelRenderer(this, 0, 0);
      layer145.addBox(-2.5F, 0F, -2.5F, 5, 1, 5);
      layer145.setRotationPoint(0F, -2F, 0F);
      layer145.setTextureSize(64, 32);
      layer145.mirror = true;
      setRotation(layer145, 0F, -0.7853982F, 0F);
      
      layer190 = new ModelRenderer(this, 0, 0);
      layer190.addBox(-2.5F, 0F, -2.5F, 5, 1, 5);
      layer190.setRotationPoint(0F, -2F, 0F);
      layer190.setTextureSize(64, 32);
      layer190.mirror = true;
      setRotation(layer190, 0F, 0F, 0F);
      
      //pole
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(-1.5F, 0F, -1.5F, 3, 17, 3);
      Shape1.setRotationPoint(0F, -19F, 0F);
      Shape1.setTextureSize(64, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      
      //layer 2
      layer1452 = new ModelRenderer(this, 0, 0);
      layer1452.addBox(-2.5F, 0F, -2.5F, 5, 1, 5);
      layer1452.setRotationPoint(0F, -20F, 0F);
      layer1452.setTextureSize(64, 32);
      layer1452.mirror = true;
      setRotation(layer1452, 0F, -0.7853982F, 0F);
      
      layer1902 = new ModelRenderer(this, 0, 0);
      layer1902.addBox(-2.5F, 0F, -2.5F, 5, 1, 5);
      layer1902.setRotationPoint(0F, -20F, 0F);
      layer1902.setTextureSize(64, 32);
      layer1902.mirror = true;
      setRotation(layer1902, 0F, 0F, 0F);
      
      //turbines
      Blade1 = new ModelRenderer(this, 0, 0);
      Blade1.addBox(-0.4666667F, 0F, -7F, 1, 17, 14);
      Blade1.setRotationPoint(0F, -19F, 0F);
      Blade1.setTextureSize(64, 32);
      Blade1.mirror = true;
      setRotation(Blade1, 0F, -0.7853982F, 0F);
      
      Blade2 = new ModelRenderer(this, 0, 0);
      Blade2.addBox(-0.5F, 0F, -7F, 1, 17, 14);
      Blade2.setRotationPoint(0F, -19F, 0F);
      Blade2.setTextureSize(64, 32);
      Blade2.mirror = true;
      setRotation(Blade2, 0F, 0F, 0F);
      
      Blade3 = new ModelRenderer(this, 0, 0);
      Blade3.addBox(-0.5F, 0F, -7F, 1, 17, 14);
      Blade3.setRotationPoint(0F, -19F, 0F);
      Blade3.setTextureSize(64, 32);
      Blade3.mirror = true;
      setRotation(Blade3, 0F, 1.570796F, 0F);
      
      Blade_4 = new ModelRenderer(this, 0, 0);
      Blade_4.addBox(-0.5F, 0F, -7F, 1, 17, 14);
      Blade_4.setRotationPoint(0F, -19F, 0F);
      Blade_4.setTextureSize(64, 32);
      Blade_4.mirror = true;
      setRotation(Blade_4, 0F, 0.7853982F, 0F);
      
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    
    setRotationAngles(f, f1, f2, f3, f4, f5,entity);
    base.render(f5);
    layer145.render(f5);
    layer190.render(f5);
    Shape1.rotationPointY=((float)Minecraft.getSystemTime()%3600)/100F;
    Shape1.render(f5);
    Blade1.rotationPointY=((float)Minecraft.getSystemTime()%3600)/100F;
    Blade1.render(f5);
    Blade2.rotationPointY=((float)Minecraft.getSystemTime()%3600)/100F;
    Blade2.render(f5);
    Blade3.rotationPointY=((float)Minecraft.getSystemTime()%3600)/100F;
    Blade3.render(f5);
    Blade_4.rotationPointY=((float)Minecraft.getSystemTime()%3600)/100F;
    Blade_4.render(f5);
    layer1452.render(f5);
    layer1902.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5,Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }

}

 

I would've used spoilers but they're derping again

The proud(ish) developer of Ancients

Link to comment
Share on other sites

the render class is fairly useless considering the "render" method is in the model but whatever. Also I will check out the  IItemRenderer tutorial.

 

package blockRenderers;

import org.lwjgl.opengl.GL11;

import com.example.gammacraft.TileEntity.TurbineTileEntity;
import com.example.gammacraft.models.ModelMiniJet;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

public class TurbineRenderer extends TileEntitySpecialRenderer{

private static ModelTurbine model;

public TurbineRenderer() {
	this.model = new ModelTurbine();
}

@Override
public void renderTileEntityAt(TileEntity te, double x, double y,double z, float scale) {
	System.out.println("rendering");


	GL11.glTranslated(x, y, z);
	this.bindTexture(new ResourceLocation("gammacraft:textures/blocks/Candle.png"));


	this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
	GL11.glTranslated(-x, -y, -z);

}

}

The proud(ish) developer of Ancients

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

    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

×
×
  • Create New...

Important Information

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