| Pages: [1] :: one page |
|
|
| Author |
Topic |

Enterrer Vivant
Starbreaker Spaceways Nex Eternus
 |
Posted - 2008.03.23 14:54:00 -
[1]
I notice that a number of applications appear to have cute little images of the local region, constellation or system. How do you dynamically create these? Is that even possible?
Any help much appreciated,
-- EV
|

BAteh
 |
Posted - 2008.03.24 01:55:00 -
[2]
Edited by: BAteh on 24/03/2008 01:54:55 The best "cute little images", imho, are from www.tanx0r.org, but i don't think tanx0r has shared with the community the method to make those sexy images, sorry...
Edit: typo :|
Please visit your user settings to re-enable images.
|

Enterrer Vivant
Starbreaker Spaceways Nex Eternus
 |
Posted - 2008.03.25 08:48:00 -
[3]
http://www.tanx0r.org/ is a great looking resource! Pity there's no contact details :(
Seems that the IGB has references like:
<IMG SRC="starmap:ids=20000509&markers=30003489::You are here::-::-"> <A HREF="showinmap:solarsystemID1//solarsystemID2//...//solarsystemIDn"> ... </A> etc
Is it possible to get these out of game some how?
-- EV
|

postal dude
Thundercats RAZOR Alliance
 |
Posted - 2008.03.25 12:19:00 -
[4]
I think the eve-dev.net killboard is doing the same thing you want. Just download the src and look how its done 
 |

Tanx0r
Stinger Squad
 |
Posted - 2008.03.27 14:59:00 -
[5]
Both the killboard and my website generate png images through the GD library which should be installed on any decent apache/php/mysql server.
What you require is the eve database dump which is available from these forums and some means of querying this data and converting it into graphics.
From there all depends wether you want this to be done as a web application or standalone client application.
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

Zathi Shaitan
Illiteracy Combatants
 |
Posted - 2008.03.27 23:46:00 -
[6]
Originally by: Tanx0r Both the killboard and my website generate png images through the GD library which should be installed on any decent apache/php/mysql server.
What you require is the eve database dump which is available from these forums and some means of querying this data and converting it into graphics.
From there all depends wether you want this to be done as a web application or standalone client application.
png+gd was obvious enough, tanx0r. :)
what was referred to, and what OP was mentioning, is THE means, not the backbone where it will run....
PS: postgres+lighttpd > apache+mysql ---- " Several unconventional alliances where made at that point " - Hey CCP, "where" != "were".. you too, Brutus? http://loseloose.com/ |

BAteh
The Graduates Brutally Clever Empire
 |
Posted - 2008.03.28 04:32:00 -
[7]
Yes, some tips would be nice.
"use apache and gd" is indeed a bit scarse. (and i agree with you Zath, pgsql+light ftw) :)

|

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 15:18:00 -
[8]
<?php // -------------------------------------------------------------------------------------------------------------- // genterri.php - generates and returns a 1600 x 1600 pixel 8 bit PNG image of a region or the entire universe // with alliance sovereignty levels depicted as icons colored by alliance ID. // -------------------------------------------------------------------------------------------------------------- // // URL variables:zoomrate = zooms in or out. Defaults to 0.9 (instead of 1.0 to get a margin) if not specified. //regionID = region to display. If not specified map defaults to entire universe. // // usage:<img src="genterri.php?regionID=$regionID&zoomrate=$zoomrate"> // --------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------- // Get variables from URL
$zoomrate = 1 * $_GET[zoomrate]; if ($zoomrate == 0) {$zoomrate = 0.9;}
include("dbstuff.php"); $handle = opendb();
$regionID = 1 * $_GET[regionID]; if ($regionID == 0) { include("getuniverse.php"); $regionName = "universe"; } else { include("getregion2.php"); $result = query ("SELECT regionName FROM mapRegions WHERE regionID = $regionID"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $regionName = $row['regionName']; } }
// -------------------------------------------------------------------------------------------------------------- // Cohen-Sutherland line clipping function.
$NDC_MIN = 0;// our canvas is 1600 x 1600 $NDC_MAX = 1599; $CLIP_LEFT = 1;// bitcode for fast clipping function $CLIP_RIGHT = 2; $CLIP_DOWN = 4; $CLIP_UP = 8;
// Return cohen-sutherland bitcode of the region an endpoint (x,z). // Regions are ordered like this (0 is our canvas): //9| 8 |10 // ---+---+--- //1| 0 | 2 // ---+---+--- //5| 4 | 6
function outcode($x, $z) { global $NDC_MIN,$NDC_MAX,$CLIP_LEFT,$CLIP_RIGHT,$CLIP_UP,$CLIP_DOWN; $code = 0; if ($z < $NDC_MIN) {$code |= $CLIP_DOWN;} if ($z > $NDC_MAX) {$code |= $CLIP_UP;} if ($x < $NDC_MIN) {$code |= $CLIP_LEFT;} if ($x > $NDC_MAX) {$code |= $CLIP_RIGHT;} return $code; }
// quick check wether or not an endpoint is inside canvas. (returns 0 = outside, 1 is inside) function inside ($x, $z) { global $NDC_MIN,$NDC_MAX,$CLIP_LEFT,$CLIP_RIGHT,$CLIP_UP,$CLIP_DOWN; if ($x < $NDC_MIN || $z > $NDC_MAX) {return 0;} if ($z < $NDC_MIN || $z > $NDC_MAX) {return 0;} return 1; }
// swap the contents of two variables function swap (&$x, &$z) { $temp = $x; $x = $z; $z = $temp; }
function lineclip (&$x1, &$z1, &$x2, &$z2) { global $NDC_MIN,$NDC_MAX,$CLIP_LEFT,$CLIP_RIGHT,$CLIP_UP,$CLIP_DOWN; while (1) { $out1 = outcode($x1,$z1); $out2 = outcode($x2,$z2); if ($out1 & $out2) // Reject as outside {return 0;} if ($out1 == 0 AND $out2 == 0) // accept as inside {return 1;} if (inside ($x1, $z1)) { swap($x1,$x2); swap($z1,$z2); swap($out1,$out2); } if ($out1 & $CLIP_UP) { $t = ($NDC_MAX - $z1) / ($z2 - $z1); $x1 += $t * ($x2 - $x1); $z1 = $NDC_MAX; } elseif ($out1 & $CLIP_DOWN) { $t = ($NDC_MIN - $z1) / ($z2 - $z1); $x1 += $t * ($x2 - $x1); $z1 = $NDC_MIN; } elseif ($out1 & $CLIP_LEFT) { $t = ($NDC_MIN - $x1) / ($x2 - $x1); $z1 += $t * ($z2 - $z1); $x1 = $UDC_MIN; } elseif ($out1 & $CLIP_RIGHT) { $t = ($NDC_MAX - $x1) / ($x2 - $x1); $z1 += $t * ($z2 - $z1); $x1 = $NDC_MAX; } $x1 = intval ($x1); $x2 = intval ($x2); $z1 = intval ($z1); $z2 = intval ($z2); } return 1; }
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 15:19:00 -
[9]
Edited by: Tanx0r on 28/03/2008 15:33:52 // ------------------------------------------------------------------------------------------------------------------------- // Create image and define colors using the GD library
$image = imagecreatefrompng("webimages/maps/evemapbackground.png") or die ("Could not create map image"); $background_color = ImageColorAllocate ($image,0,0,0); $label_color = ImageColorAllocate ($image,255,255,128);// image footer $reglabel_color = ImageColorAllocate ($image,128,128,128);// region labels $zero_color = ImageColorAllocate ($image,255,0,0);// current region 0 space color $zero2_color = ImageColorAllocate ($image,160,0,0);// other regions 0 space color $soljump_color = ImageColorAllocate ($image,0,60,120);// current region solarsystem, constellation and region jump colors $conjump_color = ImageColorAllocate ($image,110,0,0); $regjump_color = ImageColorAllocate ($image,90,0,90); $soljump2_color = ImageColorAllocate ($image,0,35,70);// other regions jump colors $conjump2_color = ImageColorAllocate ($image,60,0,0); $regjump2_color = ImageColorAllocate ($image,60,0,60); $colors2[0] = ImageColorAllocate ($image,127,0,0);// security rating colors (used for drawing empire) $colors2[1] = ImageColorAllocate ($image,127,21,0); $colors2[2] = ImageColorAllocate ($image,127,43,0); $colors2[3] = ImageColorAllocate ($image,127,64,0); $colors2[4] = ImageColorAllocate ($image,127,86,0); $colors2[5] = ImageColorAllocate ($image,127,127,0); $colors2[6] = ImageColorAllocate ($image,96,127,0); $colors2[7] = ImageColorAllocate ($image,64,127,0); $colors2[8] = ImageColorAllocate ($image,32,127,0); $colors2[9] = ImageColorAllocate ($image,0,127,0); $colors2[10] = ImageColorAllocate ($image,0,127,127);
// ------------------------------------------------------------------------------------------------------------------------- // Draw lines representing system jumps. Solarsystem jumps are blue, constellation jumps red, region jumps purple.
$result = query (" SELECTmapSolarSystemJumps.fromSolarSystemID AS fromID, mapSolarSystemJumps.toSolarSystemID AS toID, mapSolarSystemJumps.fromRegionID AS fromrID, mapSolarSystemJumps.toRegionID AS torID, mapSolarSystemJumps.fromConstellationID AS fromcID, mapSolarSystemJumps.toConstellationID AS tocID, mapSolarSystems.x AS x1, mapSolarSystems.z AS z1, mapSolarSystems.solarSystemName AS name1, mapSolarSystemz.x AS x2, mapSolarSystemz.z AS z2, mapSolarSystemz.solarSystemName AS name2 FROMmapSolarSystemJumps LEFT JOINmapSolarSystems ON mapSolarSystemJumps.fromSolarSystemID = mapSolarSystems.solarSystemID LEFT JOINmapSolarSystems AS mapSolarSystemz ON mapSolarSystemJumps.toSolarSystemID = mapSolarSystemz.solarSystemID WHEREmapSolarSystemJumps.fromSolarSystemID < mapSolarSystemJumps.toSolarSystemID ");
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $x1 = $middle + intval($multiplier *($row['x1'] - $xcenter)); $z1 = $middle + intval($multiplier *($row['z1'] - $zcenter)); $x2 = $middle + intval($multiplier *($row['x2'] - $xcenter)); $z2 = $middle + intval($multiplier *($row['z2'] - $zcenter)); if (lineclip($x1,$z1,$x2,$z2)) // clip coords and draw line if part or all of it is within our canvas. { if ($regionID == $row['fromrID'] OR $regionID == $row['torID']) { if ($row['fromrID'] != $row['torID']) {imageline ($image,$x1,$z1,$x2,$z2,$regjump2_color);} elseif ($row['fromcID'] != $row['tocID']) {imageline ($image,$x1,$z1,$x2,$z2,$conjump_color);} else {imageline ($image,$x1,$z1,$x2,$z2,$soljump_color);} } else { if ($row['fromrID'] != $row['torID']) {imageline ($image,$x1,$z1,$x2,$z2,$regjump2_color);} elseif ($row['fromcID'] != $row['tocID']) {imageline ($image,$x1,$z1,$x2,$z2,$conjump2_color);} else {imageline ($image,$x1,$z1,$x2,$z2,$soljump2_color);} } } }
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 15:20:00 -
[10]
Edited by: Tanx0r on 28/03/2008 15:36:58 Edited by: Tanx0r on 28/03/2008 15:32:41 // ------------------------------------------------------------------------------------------------------------------------- // Write region names into map
$result = query ("SELECT regionName, x, z FROM mapRegions WHERE x >= $xmin AND x <= $xmax AND z >= $zmin AND z <= $zmax"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $x = $middle + intval($multiplier *($row['x'] - $xcenter)); $z = $middle + intval($multiplier *($row['z'] - $zcenter)); imagestring($image, 5, $x, $z, "{$row['regionName']}", $reglabel_color); }
// ------------------------------------------------------------------------------------------------------------------------- // Draw all solar systems colored by security rating
$resulz = query("SELECT mapSolarSystems.regionID, mapSolarSystems.x,mapSolarSystems.z, mapSolarSystems.security FROM mapSolarSystems WHERE mapSolarSystems.x >= $xmin AND mapSolarSystems.x <= $xmax AND mapSolarSystems.z >= $zmin AND mapSolarSystems.z <= $zmax"); while($row = mysql_fetch_array($resulz, MYSQL_ASSOC)) { $x = $middle + intval($multiplier *($row['x'] - $xcenter)); $z = $middle + intval($multiplier *($row['z'] - $zcenter)); if ($row['security'] <= 0) { if ($regionID == $row['regionID']) {imageline ($image, $x, $z, $x, $z, $zero_color);} else {imageline ($image, $x, $z, $x, $z, $zero2_color);}
} else { $sec = intval (10 * $row['security']); imageline ($image, $x, $z, $x, $z, $colors2[$sec]); } } */
// ------------------------------------------------------------------------------------------------------------------------- // Write footer into image
imagestring($image, 3, 8, $canvas-16, "EVE-ONLINE $regionName map - generated by Tanx0r.org", $label_color);
// ------------------------------------------------------------------------------------------------------------------------- // Write legend into image
$x = 10; $z = 5;
imagestring($image, 2, $x-5, $z-3, "LEGEND:", $reglabel_color);
$z += 17; imageline ($image, $x-5, $z, $x+5, $z, $soljump_color);// solarsystem jump imagestring($image, 1, $x+10, $z-3, "Solarsystem jump", $reglabel_color);
$z += 10; imageline ($image, $x-5, $z, $x+5, $z, $conjump_color);// constellation jump imagestring($image, 1, $x+10, $z-3, "Constellation jump", $reglabel_color);
$z += 10; imageline ($image, $x-5, $z, $x+5, $z, $regjump_color);// region jump imagestring($image, 1, $x+10, $z-3, "Region jump", $reglabel_color);
header ("Content-type: image/png"); imagepng ($image); imagedestroy ($image);
closedb ($handle);
?>
Linkage to nberleet alliance info and sovereignty maps0rs!!! |
|

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 15:24:00 -
[11]
Edited by: Tanx0r on 28/03/2008 15:30:47 Edited by: Tanx0r on 28/03/2008 15:26:50 Some tables referred to (those starting with tanx*) will have to be taken out of the queries as you do not have those 
Enjoy.
Oh and here's the include file "getregion2.php".
<?php // --------------------------------------------------------------------------------------------------------------------- // Get minimal and maximal X, Z coordinates for the current region. Calculate the middle of it and its dimensions. // uses the variable $zoomrate to allow zooming in and out. These values are also in the eveRegions table BUT those // values are WRONG (don't blame me). $zoomrate is the variable that allows zooming in or out.
$result = query("SELECT x FROM mapSolarSystems where regionID = $regionID order by x limit 0,1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$xmin = $row['x'];}
$result = query("SELECT x FROM mapSolarSystems where regionID = $regionID order by x DESC limit 0,1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$xmax = $row['x'];}
$result = query("SELECT z FROM mapSolarSystems where regionID = $regionID order by z limit 0,1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$zmin = $row['z'];}
$result = query("SELECT z FROM mapSolarSystems where regionID = $regionID order by z DESC limit 0,1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$zmax = $row['z'];}
$xcenter = $xmin + (($xmax - $xmin) / 2); $zcenter = $zmin + (($zmax - $zmin) / 2);
$result = query("SELECT regionName FROM mapRegions where regionID = $regionID limit 0,1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$regionName = $row[regionName];}
$canvas = 1600; // canvas size in pixels $middle = $canvas / 2; $dimx = $xmax - $xmin; // map x dimension $dimz = $zmax - $zmin; // map z dimension $dime = (max($dimx, $dimz))/($zoomrate); $multiplier = $canvas / $dime; $xmin = $xcenter - ($dime / 2);// adjust minimal and maximal x, z values so our map covers a square instead of a rectangle. $xmax = $xcenter + ($dime / 2); $zmin = $zcenter - ($dime / 2); $zmax = $zcenter + ($dime / 2); ?>
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 15:29:00 -
[12]
And ofcourse "getuniverse.php":
<?php // --------------------------------------------------------------------------------------------------------------------- // Get minimal and maximal X, Z coordinates for the entire eve universe. Calculate the middle of it and its dimensions. // uses the variable $zoomrate to allow zooming in and out.
$result = query("SELECT * FROM mapUniverse where 1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $xmin = $row['xMin']; $xmax = $row['xMax']; $zmin = $row['zMin']; $zmax = $row['zMax']; }
$xcenter = $xmin + (($xmax - $xmin) / 2); $zcenter = $zmin + (($zmax - $zmin) / 2);
$canvas = 1600; // canvas size in pixels $middle = $canvas / 2; $dimx = $xmax - $xmin; // map x dimension $dimz = $zmax - $zmin; // map z dimension $dime = (max($dimx, $dimz))/($zoomrate); $multiplier = $canvas / $dime; $xmin = $xcenter - ($dime / 2);// adjust minimal and maximal x, z values so our map covers a square instead of a rectangle. $xmax = $xcenter + ($dime / 2); $zmin = $zcenter - ($dime / 2); $zmax = $zcenter + ($dime / 2); ?>
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

Tanx0r
Stinger Squad
 |
Posted - 2008.03.28 16:08:00 -
[13]
So there... Now I have "shared with the community" 
I am currently trying to convert the maps on my site to 3d vector graphic ones which will be rendered client side, as the png generating takes up a lot of resources on the webserver.
More on that coming soon.
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

BAteh
The Graduates Brutally Clever Empire
 |
Posted - 2008.03.28 17:16:00 -
[14]
Originally by: Tanx0r So there... Now I have "shared with the community" 
Sir, you rock. Many thanks. MANY. *bow*

|

Tanx0r
 |
Posted - 2008.03.29 11:27:00 -
[15]
You're welcome.
To add landmarks to the map:
$result = query ("SELECT landmarkName, description, x, z, radius FROM mapLandmarks WHERE importance != 0 AND x >= $xmin AND x <= $xmax AND z >= $zmin AND z <= $zmax ORDER by radius DESC"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $x = $middle + intval($multiplier *($row['x'] - $xcenter)); $z = $middle + intval($multiplier *($row['z'] - $zcenter)); $rad = intval($multiplier * ($row['radius'])); if ($rad == 0) {$rad = 1;} imagefilledellipse ($image, $x, $z, $rad, $rad, $landmark_color); imagefilledellipse ($image, $x, $z, 5, 5, $landmark2_color); imageellipse ($image, $x, $z, $rad, $rad, $landmark2_color); imagestring($image, 3, $x+5, $z, "{$row['landmarkName']}", $lmarklabel_color); }
All the mouseover popup and linking to solarsystems stuff on my website is done by generating html imagemaps. This is fairly straightforward and shouldn't be a problem once you managed to include the png maps in your code.
Be careful not to generate too many regions in your imagemap though as microshaft IE takes AGES to process those (in firefox this only takes a split second, proving once more that IE is really a ****ty browser).
Linkage to nberleet alliance info and sovereignty maps0rs!!! |

BAteh
 |
Posted - 2008.03.29 18:26:00 -
[16]
Thanks AGAIN. :)
IE is indeed crap. I'm still amazed by people who have doubts about that. And looking at the new acid3 tests.. IE is really pathetic.
Congrats to Opera, btw. :)
Please visit your user settings to re-enable images.
|

Cori4n
principle of motion Interstellar Alcohol Conglomerate
 |
Posted - 2008.03.30 03:05:00 -
[17]
Originally by: Tanx0r stuff
Pastebin? Just saying... 
|

Tanx0r
 |
Posted - 2008.03.30 13:31:00 -
[18]
Originally by: Cori4n
Originally by: Tanx0r stuff
Pastebin? Just saying... 
stfu
Linkage to nberleet alliance info and sovereignty maps0rs!!! |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |