Honestly I have no goddamn clue what the hell is going on with this I want it to rotate around the camera via the y axis it doesnt even make a square it just shoots around the place for no reason…
package lcass.com.graphics;
import lcass.com.control.Camera;
import lcass.com.core.core;
import lcass.com.graphics.objects.vertex;
public class RENDER3D {
private core core;
public RENDER3D(core core) {
this.core = core;
}
public void drawvertex(vertex v, Camera c,double rotx,double roty) {
double cz = c.z;
double dist = Math.abs(v.z - cz);
double tx = v.x - c.x;
double ty = v.y - c.y;
double tz = v.z - c.z;
double nx = tx * Math.cos(roty) - ty * Math.sin(roty);
double ny = tx * Math.sin(rotx) + ty * Math.cos(rotx);
double nz = tz* Math.cos(roty);
double adist = Math.abs(nz-c.z);
double dx = 0;
double dy = 0;
System.out.println(dist);
double scale = 512 /adist;
dx = (nx) * (scale /adist)+ (core.WIDTH / 2);
dy = (ny)* (scale / adist)+ (core.HEIGHT / 2);
if (dx < core.WIDTH && dy < core.HEIGHT) {
if (dx > 0 && dy > 0 && nz >=0) {
core.screen.map[(int) dx][(int) dy] = 0xFF00FF;
}
}
}
}