0

I currently have objects positioned in 'real' world positions (unit=meter). The problem is I want an object viewable a few kilometres away. When OpenGL scales this object, its too small and barely perceivable. I also have objects a few meters away, which would be too large if I simply scaled the objects.

So I was looking for a way of mapping objects a few kilometres away to be closer, and those too close to be further. I found glDepthRange, which seems to have been what I wanted, but I know believe thats more to do with ordering depth than the visual representation. Im also aware of offsetPolygon, but I doubt that will give me my desired result. I could manually transform the co-ordinates of the objects using polar co-ordinates and update them as the view moves, But it seems an awfully heavy approach.

Is there a way of achieving it. As Im using OpenGL ES 1.0, shaders are out of the question. BTW its for use in Augmented Reality.

Thanks

McP
  • 813
  • 1
  • 8
  • 16
  • You could scale everything by 0.1 or something like that instead? – Bojangles Aug 21 '12 at 12:22
  • Scaling everything would cause the objects closest to become even closer. Which isnt desired. Thanks for the comment. Instead I want them to meet in the middle. – McP Aug 21 '12 at 12:43
  • Scaling each object with the distance from your position (multiplied by some factor) should make all objects of same size no matter how far they are.. If "some factor" would be 10 the objects that are 10m away would stay the same as now, objects 2m away would be 5 times smaller then now and objects 1km away would be 100 times smaller then now.. Don't know why would you want to do that, but ok.. Other then that you could experiment with some power function of distance.. Square root of a distance might be interesting (those far away would be smaller).. – Matic Oblak Aug 21 '12 at 12:47
  • That is the way Im planning on doing it, if this falls through. The issue is getting the distance from each object without calculating it, Or more precisely having to recalculate the positions of the objects each frame. I want OpenGL to do as much work as possible, And I simply feed it initial positions. I swear I managed it a few years ago. Thanks for the reply. – McP Aug 21 '12 at 12:58
  • You could try defining the near plane of the frustum to be wider than the far plane. – mbeckish Aug 21 '12 at 14:15
  • Actually, if you want far items to be the same size as near items, just use orthographic projection. – mbeckish Aug 21 '12 at 14:23
  • @mbeckish. Ill have a go at the near plane frustum (I assume I need to apply my own matrix). Also I dont want them to be the same size, just not as different as they are, so orthographic is out. Thanks. – McP Aug 21 '12 at 16:09

0 Answers0