Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Tunnel in the sky effect

  1. #1
    Newbie Newbie
    Join Date
    Aug 2013

    Tunnel in the sky effect


    I want to implement a tunnel in the sky concept for synthetic vision system for a flight simulator. This consists of a series of rectangles/pentagons using which the pilot can fly through it and reach the runway even in bad weather conditions. I am trying to implement this. First I declared a viewport with gluPerspective projection. I defined a rectangle. I placed one on the display. I defined a glTranslate in z=direction[glTranslatef(0,0,-150)] and placed another rectangle. I expected the second rectangle to be concentric to the first. But this did not happen but the (x,y) positions of two rectangles are same although the end points are different and look concentric. Can anyone explain how to draw rectangles/pentagons as in the attached image ?
    Sorry I realise that I am not allowed to attach images nor the paper I am referring to.


  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Your logic will only work when your camera is on the z-axis and your target (lookat point) is also on the z-axis. You need to offset the rectangles along the camera-target vector if you want the tunnel to show the direction the plane is travelling. Also the rectangles need to be parallel to the up-right plane. It is probably easier to change to an orthogonal view and draw a set of concentric 2D rectangles around the center of the screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts