Search

Last Downloaded

zip-0Sandbox Utility
Exe-256-1Unstable Space Alpha

Login

Good news for mapmakers

mdvalley's Avatar Topic Author
Regular Regular
  • Posts: 143
  • Thanks: 0

Good news for mapmakers

21 years 1 month ago
#18281
I finally cracked the vertical L-Point code! Enjoy.

For the geog program:
Code:
void PlaceLpoint(Lpoint_T * data, float percentage) { Entity_T * moon; Entity_T * planet; double vecx, vecy, vecz, dist, x, y, z, angle; moon = &geog_array[data->moon_index].entity; planet = &geog_array[data->center_index].entity; vecx = moon->x_pos - planet->x_pos; vecy = moon->y_pos - planet->y_pos; vecz = moon->z_pos - planet->z_pos; dist = sqrt(vecx*vecx+vecy*vecy+vecz*vecz); x = vecx/dist; y = vecy/dist; z = vecz/dist; vecx = x*dist*percentage + planet->x_pos; vecy = y*dist*percentage + planet->y_pos; vecz = z*dist*percentage + planet->z_pos; if ( z == -1 ) // To prevent divide by zero errors if a moon is straight north { data->orient1 = (float)0; // North data->orient2 = (float)sqrt(1/2); data->orient3 = (float)sqrt(1/2); } else { angle = acos(z)/2; data->orient1 = (float)cos(angle); data->orient2 = (float)(-y*cos(angle)/(z+1)); data->orient3 = (float)(x*cos(angle)/(z+1)); }; data->x_pos = vecx; data->y_pos = vecy; data->z_pos = vecz; }

Please Log in or Create an account to join the conversation.

Second Chance's Avatar
King of Space King of Space
  • Posts: 1152
  • Thanks: 0

Re:

21 years 1 month ago
#11877
Cool! Nice job.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

tech2kjason's Avatar
I'm new here! I'm new here!
  • Posts: 9
  • Thanks: 0

Re:

20 years 10 months ago
#12155
Excellent work!

Please Log in or Create an account to join the conversation.

GrandpaTrout's Avatar
King of Space King of Space
  • Posts: 1135
  • Thanks: 0

Re:

20 years 10 months ago
#12214
Great! I will add this to the GeogSdk.

-Gtrout

Please Log in or Create an account to join the conversation.