0

So I have recently started on my own 3D renderer in Java. I have made a cube and a camera that can be moved with WASD and mouse. I have just one problem:

When the camera looks away or a point of the cube ends up on the corner of the display the renderer freaks out (it renders a polygon that shouldn't be drawn).

After debugging I saw that the renderer wanted to render a point at x: -142500 (way out of my 1500x1500 window). I then tried to fix this by implementing screen clipping (so that 142500 x coordinate would be moved to the edge of the screen). Well, that didn't work either :(

I would appreciate any help. The problem (the red is where the edge is and the blue striped area is where the white triangle should have rendered)

Edit: dropbox jar file

Filip
  • 68
  • 6
  • 1
    Edit your question and add a [mre] that demonstrates the problem. If you don’t include any code, we can’t provide any suggestions for how to improve it. – VGR Mar 16 '20 at 14:05
  • Hi Filip, welcome to StackOverflow. Following from VGR's comment, please include your code as `formatted code blocks` in the question, not external links. If there is so much code that that is not practical, please pare it down to a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – Brydenr Mar 16 '20 at 14:35

0 Answers0