Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GenerarteSphere()
- {
- //First get the current players pos to be the center of the spiral.
- new Float:centerX, Float:centerY, Float:centerZ;
- GetPlayerPos(playerid, centerX, centerY, centerZ);
- //Set the variables.. They are consts here but can be set as variables.
- new Float:a = 2.0, Float:b = 2.0;
- new size = 750;
- //Start looping.
- new Float:oldX = centerX, Float:oldY = centerY, Float:oldZ = centerZ; //used to save the latest x, y and z for creating the lines.
- for(new i; i < size; i++)
- {
- //Get the angle.
- new Float:angle = 0.1 * i;
- //Calculate X and Y.
- new Float:x = (centerX + (a + b * angle) * floatcos(angle));
- new Float:y = (centerY + (a + b * angle) * floatcos(angle));
- //Now calculate Z. (We just need to keep going upwards.. So I guess this should work).
- new Float:z = (centerZ + angle);
- //Now use the x, y and z to generate a line to those...
- CreateLineOfObjects(oldX, oldY, oldZ, x, y, z);
- //Store the new x,y,z.
- oldX = x; oldY = y; oldZ = ;
- }
- return 1;
- }
- stock CreateLineOfObjects(Float:ox, Float:ox, Float:oz, Float:nx, Float:ny, Float:nz)
- {
- //....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement