本文整理汇总了Java中net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND属性的典型用法代码示例。如果您正苦于以下问题:Java TransformType.THIRD_PERSON_RIGHT_HAND属性的具体用法?Java TransformType.THIRD_PERSON_RIGHT_HAND怎么用?Java TransformType.THIRD_PERSON_RIGHT_HAND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType
的用法示例。
在下文中一共展示了TransformType.THIRD_PERSON_RIGHT_HAND属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
@Override
public void render(ItemStack stack) {
TransformType type = lastTransform;
GlStateManager.pushMatrix();
GlStateManager.translate(0.5, 0.5, 0.5);
GlStateManager.rotate(180, 1, 0, 0);
if(type == TransformType.GUI){
GlStateManager.translate(-1, -0.1, 0);
GlStateManager.scale(0.8, 0.8, 0.8);
GlStateManager.rotate(90, 0, 1, 0);
}else if(type == TransformType.THIRD_PERSON_RIGHT_HAND){
GlStateManager.rotate(90, 0, 1, 0);
GlStateManager.rotate(80, -1, 0, 0);
GlStateManager.rotate(-50, 0, 0, 1);
GlStateManager.translate(-0.8, 0, 0.4);
}else if(type == TransformType.GROUND || type == TransformType.FIRST_PERSON_RIGHT_HAND){
GlStateManager.translate(-0.5, 0, 0.5);
GlStateManager.rotate(-45, 0, 1, 0);
}
GlStateManager.translate(-0.5, -0.5, -0.5);
int color = ItemNBTHelper.getInteger(stack, "FlagColor", Color.WHITE.getRGB());
TagManager.getInstance().renderFlag(color, 90);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.popMatrix();
}
示例2: handlePerspective
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
Matrix4f matr = new Matrix4f();
matr.setIdentity();
if (cameraTransformType == TransformType.THIRD_PERSON_RIGHT_HAND) {
matr.setTranslation(new Vector3f(0.5f, 0.375f, 0.5f));
}
if (cameraTransformType == TransformType.THIRD_PERSON_LEFT_HAND) {
matr.setTranslation(new Vector3f(-0.5f, 0.375f, 0.5f));
}
if (cameraTransformType == TransformType.FIRST_PERSON_RIGHT_HAND) {
matr.setTranslation(new Vector3f(0.25f, 0, 0.5f));
}
if (cameraTransformType == TransformType.FIRST_PERSON_LEFT_HAND) {
matr.setTranslation(new Vector3f(-0.75f, 0, 0.5f));
}
// Additional transformations
TRSRTransformation tr = bakedState.apply(Optional.of(cameraTransformType)).orNull();
if (tr != null && tr != TRSRTransformation.identity()) {
matr.mul(tr.getMatrix(), matr);
}
return Pair.of(this, matr);
}
示例3: render
@Override
public void render(ItemStack stack) {
GlStateManager.pushMatrix();
TransformType type = lastTransform;
double x = -0.5;
double y = -1;
double z = -0.5;
if(type == TransformType.GUI){
//RenderHelper.disableStandardItemLighting();
GlStateManager.scale(0.7, 0.7, 0.7);
y = -1.3;
}
if(type == TransformType.FIXED){
x = -0.5;
y = -1.3;
z = -0.5;
}
if(type == TransformType.FIRST_PERSON_LEFT_HAND){
z += 0.3;
}
if(type == TransformType.THIRD_PERSON_RIGHT_HAND){
GlStateManager.translate(4.1, -1.8, -5.1);
GlStateManager.scale(1.5, 1.5, 1.5);
GlStateManager.rotate(75, 1, 0, 1);
x = 0;
y = 3.65;
z = 0;
}
if(type == TransformType.THIRD_PERSON_LEFT_HAND){
GlStateManager.translate(-0.65, 0.8, -0.3);
GlStateManager.scale(1.5, 1.5, 1.5);
GlStateManager.rotate(70, 1, 0, -1);
x = 0;
y = -0.5;
z = 0;
}
if(type == TransformType.FIRST_PERSON_LEFT_HAND || type == TransformType.FIRST_PERSON_RIGHT_HAND){
y = -0.5;
}
//GlStateManager.disableLighting();
//GlStateManager.pushAttrib();
//RenderHelper.enableStandardItemLighting();
renderWholeBat(stack, x, y, z);
GlStateManager.enableBlend();
//GlStateManager.popAttrib();
//GlStateManager.enableLighting();
if(type == TransformType.GUI){
//RenderHelper.enableGUIStandardItemLighting();
}
GlStateManager.popMatrix();
}