Начинающий
- Статус
- Онлайн
- Регистрация
- 9 Май 2023
- Сообщения
- 165
- Реакции
- 2
- Выберите загрузчик игры
- Fabric
Чёт мне было мега скучно и решил написать кристаллы, не думал что выйдет так красиво.
Думаю многим зайдёт.
Обычный TargetESP для зенит рекода возьмите с моей прошлой темы.
Партиклы и т.д. тоже в прошлых темах сливал.
На видео чууть чууть другие, но разница лишь в количестве кристаллов.
Думаю многим зайдёт.
Обычный TargetESP для зенит рекода возьмите с моей прошлой темы.
Партиклы и т.д. тоже в прошлых темах сливал.
Пожалуйста, авторизуйтесь для просмотра ссылки.
На видео чууть чууть другие, но разница лишь в количестве кристаллов.
kristaliki:
private void renderCrystals(EventRender3D event) {
float alpha = this.animationProgress;
if (alpha <= 0.0F) return;
LivingEntity entityToRender = this.target != null ? this.target : this.lastTarget;
if (entityToRender == null) return;
float easedAnim = easeOutCubic(alpha);
float tickDelta = mc.getRenderTickCounter().getTickDelta(true);
Camera camera = mc.getEntityRenderDispatcher().camera;
Vec3d targetPos = MathUtil.interpolate(entityToRender);
Vec3d cameraPos = camera.getPos();
Vec3d renderPos = targetPos.subtract(cameraPos);
float time = (mc.player.age + tickDelta) * 6.0f;
float entityHeight = entityToRender.getHeight();
float entityWidth = entityToRender.getWidth();
float halfWidth = entityWidth * 0.5f;
MatrixStack matrices = event.getMatrix();
matrices.push();
matrices.translate(renderPos.x, renderPos.y, renderPos.z);
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE);
RenderSystem.disableCull();
if (throughWalls.isEnabled()) {
RenderSystem.disableDepthTest();
RenderSystem.depthMask(false);
} else {
RenderSystem.enableDepthTest();
RenderSystem.depthMask(false);
}
int crystalCount = 14;
for (int i = 0; i < crystalCount; i++) {
float seed1 = (float) Math.sin(i * 1.7f + 0.3f) * 0.5f + 0.5f;
float seed2 = (float) Math.cos(i * 2.3f + 0.7f) * 0.5f + 0.5f;
float seed3 = (float) Math.sin(i * 3.1f + 1.1f) * 0.5f + 0.5f;
float angleOffset = i * (360f / crystalCount) + seed1 * 12f;
float angle = time + angleOffset;
float radius = halfWidth + 0.25f + seed3 * 0.15f;
float x = radius * (float) Math.cos(Math.toRadians(angle));
float z = radius * (float) Math.sin(Math.toRadians(angle));
float y = seed2 * entityHeight;
float crystalScale = 0.18f * easedAnim;
int color = getThemeColorAngle(i * 26);
drawCrystalB(matrices, camera, x, y, z, crystalScale * 3.6f, color, alpha * 0.3f);
}
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR);
for (int i = 0; i < crystalCount; i++) {
float seed1 = (float) Math.sin(i * 1.7f + 0.3f) * 0.5f + 0.5f;
float seed2 = (float) Math.cos(i * 2.3f + 0.7f) * 0.5f + 0.5f;
float seed3 = (float) Math.sin(i * 3.1f + 1.1f) * 0.5f + 0.5f;
float angleOffset = i * (360f / crystalCount) + seed1 * 12f;
float angle = time + angleOffset;
float radius = halfWidth + 0.25f + seed3 * 0.15f;
float x = radius * (float) Math.cos(Math.toRadians(angle));
float z = radius * (float) Math.sin(Math.toRadians(angle));
float y = seed2 * entityHeight;
float crystalScale = 0.18f * easedAnim;
float dirAngle = angle;
int color = getThemeColorAngle(i * 26);
drawCrystalH(buffer, matrices, x, y, z, crystalScale, dirAngle, color, alpha * 0.7f);
}
BufferRenderer.drawWithGlobalProgram(buffer.end());
matrices.pop();
RenderSystem.enableCull();
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
RenderSystem.defaultBlendFunc();
RenderSystem.disableBlend();
}
private void drawCrystalB(MatrixStack matrices, Camera camera,
float x, float y, float z, float size, int color, float alpha) {
MatrixStack tempMatrix = new MatrixStack();
tempMatrix.multiplyPositionMatrix(matrices.peek().getPositionMatrix());
tempMatrix.translate(x, y, z);
tempMatrix.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-camera.getYaw()));
tempMatrix.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
MatrixStack.Entry entry = tempMatrix.peek().copy();
int finalColor = ColorUtil.multAlpha(color, alpha);
Vector4i vColor = new Vector4i(finalColor, finalColor, finalColor, finalColor);
Render3DUtil.drawGlowTexture(entry, bloom, -size / 2, -size / 2, size, size, vColor, !throughWalls.isEnabled());
}
private void drawCrystalH(BufferBuilder buffer, MatrixStack matrices,
float x, float y, float z, float scale,
float yaw, int color, float alpha) {
matrices.push();
matrices.translate(x, y, z);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-yaw + 90f));
matrices.scale(scale, scale, scale);
MatrixStack.Entry entry = matrices.peek();
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
int a = (int) (180 * alpha);
int rL = Math.min(255, (int)(r * 1.3f));
int gL = Math.min(255, (int)(g * 1.3f));
int bL = Math.min(255, (int)(b * 1.3f));
int rD = (int)(r * 0.6f);
int gD = (int)(g * 0.6f);
int bD = (int)(b * 0.6f);
float w = 0.5f;
float h = 1.0f;
drawTriangle(buffer, entry, 0, 0, h, -w, 0, 0, 0, w, 0, rL, gL, bL, a);
drawTriangle(buffer, entry, 0, 0, h, 0, w, 0, w, 0, 0, rL, gL, bL, a);
drawTriangle(buffer, entry, 0, 0, h, w, 0, 0, 0, -w, 0, r, g, b, a);
drawTriangle(buffer, entry, 0, 0, h, 0, -w, 0, -w, 0, 0, r, g, b, a);
drawTriangle(buffer, entry, 0, 0, -h, 0, w, 0, -w, 0, 0, rD, gD, bD, a);
drawTriangle(buffer, entry, 0, 0, -h, w, 0, 0, 0, w, 0, rD, gD, bD, a);
drawTriangle(buffer, entry, 0, 0, -h, 0, -w, 0, w, 0, 0, rD, gD, bD, a);
drawTriangle(buffer, entry, 0, 0, -h, -w, 0, 0, 0, -w, 0, rD, gD, bD, a);
matrices.pop();
}
private void drawTriangle(BufferBuilder buffer, MatrixStack.Entry entry,
float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
int r, int g, int b, int a) {
buffer.vertex(entry, x1, y1, z1).color(r, g, b, a);
buffer.vertex(entry, x2, y2, z2).color(r, g, b, a);
buffer.vertex(entry, x3, y3, z3).color(r, g, b, a);
}
Последнее редактирование:






