Вопрос Expensive 3.1 target Esp 3d

Начинающий
Статус
Онлайн
Регистрация
8 Мар 2024
Сообщения
562
Реакции[?]
2
Поинты[?]
2K
как сделать из кода 2д в 3д?,хелп
Код:
@Subscribe
private void onDisplay(EventDisplay e) {
if (this.mod.is("Призраки")) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}

if (this.killAura.isState() && this.killAura.getTarget() != null) {
double time = (double) System.currentTimeMillis() / (570.0 / 4);
double sin = Math.sin(time);
double cos = Math.cos(time);
Vector3d legPos2 = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / -15.0F), 0.0);
Vector3d bodyPos = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / 5.0F), 0.0);
Vector3d legPos = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / 2.0F), 0.0);
Vector3d[] upperPositions = new Vector3d[]{bodyPos.add(0.0, 0.5, 0.0)};
Vector3d[] lowerPositions = new Vector3d[]{legPos2.add(0.0, 0.6, 0.0)};
Vector3d[] absPositions = new Vector3d[]{legPos.add(0.0, 0.5, 0.0)};
ResourceLocation image = new ResourceLocation("expensive/images/circleglow2.png");

for (int j = 0; j < 40; ++j) {
float alpha = (float) (140 - j * 9);
if (alpha < 0.0F) {
alpha = 0.0F;
}

float trailSize = 40 * (1.0F - (float) j * -0.02F);
double trailTime = time - (double) j * 0.1;
double trailSin = Math.sin(trailTime);
double trailCos = Math.cos(trailTime);
float angleOffset = (float) j * 7.2F;

int i;
Vector3d pos3d;
Vector2f pos;
for (i = 0; i < upperPositions.length; ++i) {
pos3d = upperPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0); //середина
                    pos = ProjectionUtil.project(pos3d.x + trailCos * 0.9, pos3d.y, pos3d.z + trailSin * 0.9);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}

for (i = 0; i < lowerPositions.length; ++i) {
pos3d = lowerPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0);
pos = ProjectionUtil.project(pos3d.x - trailCos * 0.9, pos3d.y, pos3d.z - trailSin * 0.9);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (-trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}
for (i = 0; i < absPositions.length; ++i) {
pos3d = absPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0);
pos = ProjectionUtil.project(pos3d.x - trailCos * 0.9, pos3d.y, pos3d.z - trailSin * 0.9); //0.5
                    GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (-trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}
}
}
}
 
Начинающий
Статус
Онлайн
Регистрация
8 Мар 2024
Сообщения
562
Реакции[?]
2
Поинты[?]
2K
как сделать из кода 2д в 3д?,хелп
Код:
@Subscribe
private void onDisplay(EventDisplay e) {
if (this.mod.is("Призраки")) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}

if (this.killAura.isState() && this.killAura.getTarget() != null) {
double time = (double) System.currentTimeMillis() / (570.0 / 4);
double sin = Math.sin(time);
double cos = Math.cos(time);
Vector3d legPos2 = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / -15.0F), 0.0);
Vector3d bodyPos = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / 5.0F), 0.0);
Vector3d legPos = this.killAura.getTarget().getPositon(e.getPartialTicks()).add(0.0, (this.killAura.getTarget().getHeight() / 2.0F), 0.0);
Vector3d[] upperPositions = new Vector3d[]{bodyPos.add(0.0, 0.5, 0.0)};
Vector3d[] lowerPositions = new Vector3d[]{legPos2.add(0.0, 0.6, 0.0)};
Vector3d[] absPositions = new Vector3d[]{legPos.add(0.0, 0.5, 0.0)};
ResourceLocation image = new ResourceLocation("expensive/images/circleglow2.png");

for (int j = 0; j < 40; ++j) {
float alpha = (float) (140 - j * 9);
if (alpha < 0.0F) {
alpha = 0.0F;
}

float trailSize = 40 * (1.0F - (float) j * -0.02F);
double trailTime = time - (double) j * 0.1;
double trailSin = Math.sin(trailTime);
double trailCos = Math.cos(trailTime);
float angleOffset = (float) j * 7.2F;

int i;
Vector3d pos3d;
Vector2f pos;
for (i = 0; i < upperPositions.length; ++i) {
pos3d = upperPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0); //середина
                    pos = ProjectionUtil.project(pos3d.x + trailCos * 0.9, pos3d.y, pos3d.z + trailSin * 0.9);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}

for (i = 0; i < lowerPositions.length; ++i) {
pos3d = lowerPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0);
pos = ProjectionUtil.project(pos3d.x - trailCos * 0.9, pos3d.y, pos3d.z - trailSin * 0.9);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (-trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}
for (i = 0; i < absPositions.length; ++i) {
pos3d = absPositions[i].add(0.0, Math.sin(trailTime) * 0.16, 0.0);
pos = ProjectionUtil.project(pos3d.x - trailCos * 0.9, pos3d.y, pos3d.z - trailSin * 0.9); //0.5
                    GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0.0F);
GlStateManager.rotatef((float) (-trailSin * 360.0 + (double) (i * 180) + (double) angleOffset), 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(-pos.x, -pos.y, 0.0F);
DisplayUtils.drawImage(image, pos.x - trailSize / 2.0F, pos.y - trailSize / 2.0F, trailSize, trailSize,
new Vector4i(ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha),
ColorUtils.setAlpha(HUD.getColor(90, 1.0F), (int) alpha)));
GlStateManager.popMatrix();
}
}
}
}
 
Сверху Снизу