热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

net.minecraft.client.renderer.GlStateManager.rotate()方法的使用及代码示例

本文整理了Java中net.minecraft.client.renderer.GlStateManager.rotate()方法的一些代码示例,展示了Gl

本文整理了Java中net.minecraft.client.renderer.GlStateManager.rotate()方法的一些代码示例,展示了GlStateManager.rotate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GlStateManager.rotate()方法的具体详情如下:
包路径:net.minecraft.client.renderer.GlStateManager
类名称:GlStateManager
方法名:rotate

GlStateManager.rotate介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

public void glRotateCurrentMat()
{
GlStateManager.rotate( this.rot.x, 1, 0, 0 );
GlStateManager.rotate( this.rot.y, 0, 1, 0 );
GlStateManager.rotate( this.rot.z, 0, 0, 1 );
}

代码示例来源:origin: Vazkii/Botania

/**
* Shifts the render for a bauble correctly to the face.
* Use for renders under {@link RenderType#HEAD}, and usually after calling {@link Helper#translateToHeadLevel(EntityPlayer)}.
*/
public static void translateToFace() {
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(0f, -4.35f, -1.27f);
}

代码示例来源:origin: Vazkii/Botania

private static void transformFirstPerson(EnumHandSide p_187453_1_, float p_187453_2_)
{
int i = p_187453_1_ == EnumHandSide.RIGHT ? 1 : -1;
// Botania - added
GlStateManager.translate(p_187453_1_ == EnumHandSide.RIGHT ? 0.2F : 0.52F, -0.125F, p_187453_1_ == EnumHandSide.RIGHT ? 0.6F : 0.25F);
GlStateManager.rotate(p_187453_1_ == EnumHandSide.RIGHT ? 60F : 120F, 0F, 1F, 0F);
GlStateManager.rotate(30F, 0F, 0F, -1F);
// End add
float f = MathHelper.sin(p_187453_2_ * p_187453_2_ * (float)Math.PI);
GlStateManager.rotate(i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F);
float f1 = MathHelper.sin(MathHelper.sqrt(p_187453_2_) * (float)Math.PI);
GlStateManager.rotate(i * f1 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(i * -45.0F, 0.0F, 1.0F, 0.0F);
}

代码示例来源:origin: Vazkii/Botania

/**
* Rotates the render for a bauble correctly for a sneaking player.
* Use for renders under {@link RenderType#BODY}.
*/
public static void applySneakingRotation() {
GlStateManager.translate(0F, 0.2F, 0F);
GlStateManager.rotate(90F / (float) Math.PI, 1.0F, 0.0F, 0.0F);
}

代码示例来源:origin: Vazkii/Botania

/**
* Shifts the render for a bauble correctly to the chest.
* Use for renders under {@link RenderType#BODY}, and usually after calling {@link Helper#rotateIfSneaking(EntityPlayer)}.
*/
public static void translateToChest() {
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(0F, -3.2F, -0.85F);
}

代码示例来源:origin: Vazkii/Botania

@Override
public void doRenderLayer(@Nonnull EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
String name = player.getDisplayName().getUnformattedText();
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks;
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
GlStateManager.pushMatrix();
GlStateManager.rotate(yawOffset, 0, -1, 0);
GlStateManager.rotate(yaw - 270, 0, 1, 0);
GlStateManager.rotate(pitch, 0, 0, 1);
if(name.equals("haighyorkie"))
renderGoldfish(player);
firstStart();
name = name.toLowerCase();
if(player.isWearing(EnumPlayerModelParts.CAPE) && flowerMap.containsKey(name))
renderFlower(player, flowerMap.get(name));
GlStateManager.popMatrix();
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.HEAD) {
Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.scale(0.8, 0.8, 0.8);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0.1625, -1.625, 0.40);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(this, 1), ItemCameraTransforms.TransformType.GROUND);
}
}

代码示例来源:origin: Vazkii/Botania

@SuppressWarnings("deprecation")
private static void renderFlower(EntityPlayer player, ItemStack flower) {
GlStateManager.pushMatrix();
Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.translate(0, -0.85, 0);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.scale(0.5, 0.5, 0.5);
ShaderHelper.useShader(ShaderHelper.gold);
Minecraft.getMinecraft().getRenderItem().renderItem(flower, player, ItemCameraTransforms.TransformType.NONE, false);
ShaderHelper.releaseShader();
GlStateManager.popMatrix();
}

代码示例来源:origin: Vazkii/Botania

private static void renderGoldfish(EntityPlayer player) {
GlStateManager.pushMatrix();
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.goldfishIcon;
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
Helper.rotateIfSneaking(player);
GlStateManager.rotate(180F, 0F, 0F, 1F);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.translate(-0.5F, 1.6F, 0F);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
GlStateManager.popMatrix();
}

代码示例来源:origin: Vazkii/Botania

@Override
public void render(@Nonnull TilePrism prism, double x, double y, double z, float partTicks, int digProgress, float unused) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F;
ItemStack stack = prism.getItemHandler().getStackInSlot(0);
if(!stack.isEmpty()) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
if(stack.getItem() instanceof ILens) {
GlStateManager.pushMatrix();
GlStateManager.rotate(90F, 1F, 0F, 0F);
GlStateManager.translate(0.5F, 0.5F, pos);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}
GlStateManager.popMatrix();
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.itemFinderGem;
if(type == RenderType.HEAD) {
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty();
Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.4F, -1.4F, armor ? -0.3F : -0.25F);
GlStateManager.scale(0.75F, 0.75F, 0.75F);
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 16F);
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.36F, -0.3F, armor ? 0.2F : 0.15F);
GlStateManager.rotate(-45F, 0F, 0F, 1F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.snowflakePendantGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}

代码示例来源:origin: Vazkii/Botania

public void render(float fract) {
float f5 = 1F / 16F;
base.render(f5);
pipe.render(f5);
//float fract = Math.max(0.1F, (float) (Math.sin(((double) ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.5F);
float mov = (1F - fract) * 0.5F;
GlStateManager.translate(0F, mov, 0F);
top.render(f5);
GlStateManager.translate(0F, -mov, 0F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.19F, -1.375F, -0.19F);
GlStateManager.scale(1F, fract, 1F);
funnel.render(f5);
GlStateManager.scale(1F, 1F / fract, 1F);
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if (type == RenderType.HEAD) {
GlStateManager.pushMatrix();
Helper.translateToHeadLevel(player);
Helper.translateToFace();
Helper.defaultTransforms();
GlStateManager.rotate(-90F, 0F, 1F, 0F);
GlStateManager.translate(0.5F, 0.2F, 0.45F);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}

代码示例来源:origin: Vazkii/Botania

@SideOnly(Side.CLIENT)
public static void renderOnPlayer(ItemStack stack, EntityPlayer player) {
if(hasAnyWill(stack) && !((ItemTerrasteelArmor) stack.getItem()).hasPhantomInk(stack)) {
GlStateManager.pushMatrix();
float f = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMinU();
float f1 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMaxU();
float f2 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMinV();
float f3 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMaxV();
IBaubleRender.Helper.translateToHeadLevel(player);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.rotate(90F, 0F, 1F, 0F);
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.26F, -1.45F, -0.39F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getIconWidth(), MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getIconHeight(), 1F / 16F);
GlStateManager.popMatrix();
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.HEAD) {
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.translateToHeadLevel(player);
Helper.translateToFace();
Helper.defaultTransforms();
GlStateManager.rotate(180F, 0F, 1F, 0F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.5F, -0.2F, armor ? 0.12F : 0F);
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.2F, -0.45F, armor ? 0.2F : 0.15F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.nimbusGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.translate(-0.5, -0.90, armor ? -0.4 : -0.25);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.pyroclastGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.rotate(180F, 1F, 0F, 0F);
GlStateManager.translate(-0.2F, -0.3F, armor ? 0.2F : 0.15F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.cirrusGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Helper.rotateIfSneaking(player);
boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty();
GlStateManager.scale(0.5, 0.5, 0.5);
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.translate(-0.5, -0.90, armor ? -0.4 : -0.25);
TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.crimsonGem;
float f = gemIcon.getMinU();
float f1 = gemIcon.getMaxU();
float f2 = gemIcon.getMinV();
float f3 = gemIcon.getMaxV();
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F);
}
}
}

推荐阅读
author-avatar
小菜鸟
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有