rewrite of sky dome code

Add more points to the dome, giving it a dome shape rather than a
dunce cap shape.

Represent as OpenGL DrawElements instead of as triangle strips.

Only calculate have the sky colors and reflect those across the dome.
This commit is contained in:
timoore
2008-04-14 21:44:21 +00:00
parent 5e4c4725bc
commit c7dab4abea
4 changed files with 180 additions and 311 deletions
+1
View File
@@ -20,6 +20,7 @@ include_HEADERS = \
sg_random.h \
sg_types.hxx \
vector.hxx \
Math.hxx \
SGBox.hxx \
SGCMath.hxx \
SGGeoc.hxx \
+23
View File
@@ -0,0 +1,23 @@
#ifndef SIMGEAR_MATH_MATH_HXX
#define SIMGEAR_MATH_MATH_HXX 1
namespace simgear
{
namespace math
{
/** Linear interpolation between two values.
*/
template<typename T>
inline T lerp(const T& x, const T& y, double alpha)
{
return x * (1.0 - alpha) + y * alpha;
}
template<typename T>
inline T lerp(const T& x, const T& y, float alpha)
{
return x * (1.0f - alpha) + y * alpha;
}
}
}
#endif