[Fix] Fixed that darn gas giant rendering. "Yeah, that's looks like a
planet!"
This commit is contained in:
parent
1a8689d0fe
commit
1550893bcf
BIN
screenshot/fixed_gas_giant.png
Normal file
BIN
screenshot/fixed_gas_giant.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 551 KiB |
@ -28,7 +28,7 @@ void Planet::SetPosition(vector3d p) {
|
||||
}
|
||||
|
||||
void Planet::SetRadius(double radius) {
|
||||
radius = radius;
|
||||
this->radius = radius;
|
||||
dGeomSphereSetRadius(geom, radius);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ static void subdivide(vector3d& v1, vector3d& v2, vector3d& v3, vector3d& v4, in
|
||||
ff9 = (r*v9).z > 0;
|
||||
#endif
|
||||
|
||||
subdivide(v1, v5, v8, v8, depth);
|
||||
subdivide(v1, v5, v9, v8, depth);
|
||||
subdivide(v5, v2, v6, v9, depth);
|
||||
subdivide(v9, v6, v3, v7, depth);
|
||||
subdivide(v8, v9, v7, v4, depth);
|
||||
@ -113,7 +113,7 @@ static void DrawLovelyRoundCube(double radius) {
|
||||
|
||||
//glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_NORMALIZE);
|
||||
subdivide(p1, p2, p3, p3, 4);
|
||||
subdivide(p1, p2, p3, p4, 4);
|
||||
subdivide(p4, p3, p7, p8, 4);
|
||||
subdivide(p1, p4, p8, p5, 4);
|
||||
subdivide(p2, p1, p5, p6, 4);
|
||||
@ -185,7 +185,7 @@ void DrawBlob(float latitude, float longitude, float a, float b) {
|
||||
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
PutPolarPoint(latitude, longitude);
|
||||
for(double theta = 2*M_PI; theta > 2; theta -= 0.1) {
|
||||
for(double theta = 2*M_PI; theta > 0; theta -= 0.1) {
|
||||
double _lat = latitude + a * cos(theta);
|
||||
double _long = longitude + b * sin(theta);
|
||||
PutPolarPoint(_lat, _long);
|
||||
@ -514,7 +514,7 @@ void Planet::DrawGasGiant(void) {
|
||||
while(n-- > 0) {
|
||||
ggdef.hoopCol.GenCol(col, rng);
|
||||
SetMaterialColor(col);
|
||||
DrawHoop(rng(0,9*M_PI)-0.45*M_PI, rng(0.25), ggdef.hoopWobble, rng);
|
||||
DrawHoop(rng(0.9*M_PI)-0.45*M_PI, rng(0.25), ggdef.hoopWobble, rng);
|
||||
}
|
||||
|
||||
n = rng(ggdef.blobMin, ggdef.blobMax);
|
||||
|
Loading…
Reference in New Issue
Block a user