float yOffset = -row * 3 / 16.0f; transform.setTranslation( new Vector3f( xOffset, yOffset, 0 ) );
@Nonnull @Override @SideOnly(Side.CLIENT) public Pair<IBakedModel, Matrix4f> getModel(@Nonnull IVehicleAccess access) { Pair<IBakedModel, Matrix4f> model = handler.getModel(0); Matrix4f transform = new Matrix4f(); transform.setIdentity(); // Center the view (-0.5) and then move half a pixel back out. transform.setTranslation(new Vector3f(0, 0, -0.5f + (1 / 32.0f))); transform.mul(transform, model.getRight()); return Pair.of(model.getLeft(), transform); }
float yOffset = -row * 3 * scale; transform.setTranslation(new Vector3f(xOffset, -3 * scale + yOffset, 0));
public ItemRendererPhaser() { super(new ResourceLocation(MODEL)); phaserTextureColorMask = new ResourceLocation(TEXTURE_COLOR_MASK); Matrix4f mat = new Matrix4f(); mat.setIdentity(); mat.mul(getCombinedRotation(45f, 120f, 0f)); mat.setTranslation(new Vector3f(0.2f, 2.1f, 0f)); mat.setScale(2.65f); transforms.put(ItemCameraTransforms.TransformType.GUI, mat); }
public void init() { createModel(this.weaponModelLocation); loadWeaponMetadata(); identity = new Matrix4f(); identity.setIdentity(); Matrix4f mat = new Matrix4f(); mat.setIdentity(); mat.rotY((float) Math.toRadians(180)); mat.setTranslation(new Vector3f(-0.8f, 0.8f, -0.6f)); mat.setScale(1.6f); transforms.put(ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, mat); mat = new Matrix4f(); mat.setIdentity(); mat.mul(getCombinedRotation(20f, 45f, 0f)); mat.setTranslation(new Vector3f(0.8f, 0.9f, 0f)); mat.setScale(1.5f); transforms.put(ItemCameraTransforms.TransformType.GUI, mat); mat = new Matrix4f(); mat.setIdentity(); mat.setTranslation(new Vector3f(0.6f, 0.5f, 0.3f)); mat.setScale(1.2f); transforms.put(ItemCameraTransforms.TransformType.GROUND, mat); }
transform.setTranslation(new Vector3f(4 * scale, yOffset, 0)); break; case EAST: transform.setTranslation(new Vector3f(0, yOffset, -4 * scale)); break; case WEST: transform.setTranslation(new Vector3f(0, yOffset, 4 * scale)); break; default: transform.setTranslation(new Vector3f(-4 * scale, yOffset, 0));
temp.setTranslation(new Vector3f((float) x + ox, (float) y + 0.375f + oy, (float) z + oz)); trans.mul(temp); temp.setTranslation(new Vector3f(-0.5F, (float) (offset - 8) / 16.0F, 0.5F)); trans.mul(temp);