[Kstars-devel] OpenGL: the beginning

Pablo de Vicente p.devicente at wanadoo.es
Thu Dec 4 22:41:57 CET 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Jueves, 27 de Noviembre de 2003 19:58, Jason Harris escribió:
> Hello,
>
> I have started an OpenGL framework that I plan to evolve into a
> replacement for our SkyMap widget.  Actually, my plan is to include
> both SkyMap and SkyMapGL, and let configure determine which should be
> used.

Jason,

  I have looking at the code in kglwidget.cpp trying to understand it but I 
have no been very successful. I understand some parts and others not. For 
example I understand that makeObject creates a cube. In order to see it I 
have uncommented the line which says:
   glCallList( object );  in method paintGL()
and I have reduced the size of the cube by diving by 10 the cartesian 
coordinates in the glVertex3f() calls. Recompiling and running the 
application one sees the cube inside the sphere. The problem is that I do not 
understand why I cannot see the complete cube. Sometimes parts of the cube 
are clipped off and you cannot see them as if the cube were cutted by the 
sphere or a plane in the backward. How can one disable this?.

I think that I understand how translation and rotation work but I understand 
nothing of what the method doProjection() does. Can you give me a hint 
please?. I do not understand what are the calls doing. I should probably find 
a tutorial or documentation which explains what these projections are about.

All these questions aim to the following. The scheme you have presented allows 
to draw the stars with the sphere in the background. One turns the camera and 
sees other parts of the sphere, you can even change the field of view and it 
acts as a zoom. But how does one translate the camera. Is it 
glTranslatef( xtrans,ytrasn,ztrans); the way to do this?. I have tested this 
by giving xtrans a value different from 0 and the sphere is displaced to one 
side, together with the cube. But the cube still has sides that are hidden. 
Rotation, now does not rotate the camera but the object.

If one tries to see the stars from outside the Earth and from outside the 
solar system one should make a translation of the camera to see the stars 
from outside. Now pressing the keys rotates all the objects (for example the 
solar system) around some axis in the center of the sphere (the solar system 
in this case).

 I apologize if this is a bit confusing. To conclude this message, since you 
have written this code, have you found a place where some of the functions 
used are explained and which I could read?.

best regards,

Pablo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/z6ovSItUpHl6kJERAh23AJ9jCcbNRGevQ1g30ppAk/CdnXzNfACgiZ1c
VwcZKoAKuu9FqHqfXZUP6Ec=
=7DoE
-----END PGP SIGNATURE-----



More information about the Kstars-devel mailing list