0
votes

I am writing a Starmap in OpenGL (current), but since the stars are at astronomical distances, they make the near/far settings too big. These are intended to be accurate visualizations of true stars. I tried to rescale the z values of the points in the vertex shader after going through the projection matrix, but it appears I still get them moving around due to the perspective divide. Is there a way to rescale Z to fit within a smaller near/far range, without having the x/Y change in a perspective view? Can I do something with the W coordinate? Note that the stars are just a set of points.

1
Not a direct answer, but you might want to read this : outerra.blogspot.fr/2012/11/… - Calvin1602

1 Answers

1
votes

It's perfectly possible to have a far plane at infinity. The GLM library provides a function infinitePerspective to create an appropriate projection matrix for such uses. Googling "projection matrix infinite" yields a lot of articles on the topic.