working on 3D camera
This commit is contained in:
@ -52,8 +52,9 @@ class Ball
|
||||
}
|
||||
else if(ctx instanceof WebGLRenderingContext)
|
||||
{
|
||||
console.log((this.position.x - this.size / 2) / 10, 0, (this.position.y - this.size / 2) / 10)
|
||||
renderCube(ctx, (this.position.x - this.size / 2) / 10, 0, (this.position.y - this.size / 2) / 10, 0, this.size * 10, this.size * 10, this.size * 10);
|
||||
const posx = (this.position.x - this.size / 2) / 2;
|
||||
const posy = (this.position.y - this.size / 2) / 2;
|
||||
renderCube(ctx, posx, 0, posy, 0, this.size * 5, this.size * 5, this.size * 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -121,9 +121,12 @@ class Game
|
||||
this.draw_sides(ctx);
|
||||
this.ball.render(ctx);
|
||||
|
||||
ctx.strokeStyle = "#000000";
|
||||
ctx.lineWidth = this.config.stroke_thickness;
|
||||
ctx.stroke();
|
||||
if(ctx instanceof CanvasRenderingContext2D)
|
||||
{
|
||||
ctx.strokeStyle = "#000000";
|
||||
ctx.lineWidth = this.config.stroke_thickness;
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
_send(data)
|
||||
|
Reference in New Issue
Block a user