Giter Site home page Giter Site logo

ed3d-galaxy-map's Introduction

ED3D-Galaxy-Map

ED3D-Galaxy-Map is a 3D galactic map (web app) for the game Elite: Dangerous. Work with JSon file to embed stellar systems data.

Demo

Features

  • JSON file to fill the map.
  • Manage click event to display information related to a system (if detailed infos, need to be in the JSON file).
  • Display a global view of the galaxy that reproduces the ingame galaxy - Generated from a volumetric particle cloud from an ingame screenshot (a kind of heightmap).
  • HUD with customizable categories to filter the map. [Optional]
  • CSS+HTML HUD to fit to any style.
  • Systems colorizations using color attribute that can be set on each category and soon use color from ingame stellar type (if stellar type defined in JSon file for each system). [Optional]
  • Can show exploration routes.

Requirement

Require Three.js (r75) & JQuery

Options

container: The container ID. (Required)

jsonPath: The JSon containing systems data. (Required)

jsonContainer: Optionaly set an Id of container with JSon systems data. (Can be used on small project, JSon file stay better).

json: Optionaly set an object to load the systems data.

basePath: Custom base path

Sprites

starSprite: Add a custom sprite image for stars, exemple for round stars: "textures/lensflare/star_round.png" (default: "textures/lensflare/star_grey2.png")

systemColor: Set custom color(Hex) for system's sprite Default: #eeeeee

effectScaleSystem: Set an array with min & max value for system scale effect (sprite size) on zoom in/out Default: [10,800]

Camera

startAnim: Use initial animation (Zoom into the galaxy) Default: true

playerPos: [x,y,z] Player position, ex.:[150,269,28] (used for initial camera target position) Default: [0,0,0]

cameraPos: [x,y,z] Initial camera position, ex.:[0,45000,-45000] (used for initial camera position)

Hud

withHudPanel: Enable the HUD (panel to filter and navigate throughout systems). Default: false

withOptionsPanel: Enable the HUD (panel to filter and navigate throughout systems). Default: false

hudMultipleSelect: Enable showing multiple filters at same time Default: true

withFullscreenToggle: Enable button to toggle fullscreen mode Default: false

popupDetail: Popup mode for onclick details Default: false

Labels

showGalaxyInfos: Show Milky Way info on start Default: false

showNameNear: Show labels close from the camera target (Default: false)

Methods

Ed3d.init({options}): Initialize the scene

Ed3d.rebuild(): Destroy & rebuild the scene (Hard way to refresh the scene to load new JSon data)

System properties

  • name
  • coords
  • infos
  • url

Event on click

$( document ).on( "systemClick", function( event, name, infos, url ) {

});

Exemple

<!-- My container -->
<div id="edmap"></div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- Three.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r73/three.min.js"></script>
<!-- Launch ED3Dmap -->
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<script src="js/ed3dmap.min.js"></script>
<script type="text/javascript">
  Ed3d.init({
      container   : 'edmap',
      jsonPath    : "./map/system.json"
  });
</script>

JSon sample

Simple systems list

[
  {
    "name": "Sol",
    "coords": {
      "x": 0,
      "y": 0,
      "z": 0
    }
  },
  {
    "name": "Solati",
    "coords": {
      "x": 66.53125,
      "y": 29.1875,
      "z": 34.6875
    }
  }
]

Systems list with routes

{
  "systems": [
    {
      "name": "Wolf 906",
      "coords": {
          "x": "-27",
          "y": "-25",
          "z": "29"
      }
    },
    {
      "name": "Checkpoint 1",
      "coords": {
          "x": "-6644",
          "y": "-21",
          "z": "11738"
      }
    },
    {
      "name": "Checkpoint 2",
      "coords": {
          "x": "-10534",
          "y": "-21",
          "z": "16384"
      }
    },
    {
      "name": "Checkpoint 3",
      "coords": {
          "x": "-4969",
          "y": "-21",
          "z": "22262"
      }
    },
    {
      "name": "Checkpoint 4",
      "coords": {
          "x": "3553",
          "y": "-21",
          "z": "8732"
      }
    },
    {
      "name": "Checkpoint 5",
      "coords": {
          "x": "6297",
          "y": "-21",
          "z": "14626"
      }
    },
    {
      "name": "Checkpoint 6",
      "coords": {
          "x": "18975",
          "y": "-21",
          "z": "25676"
      }
    },
    {
      "name": "Sagittarius A*",
      "coords": {
          "x": "25",
          "y": "-21",
          "z": "25900"
      }
    }
  ],
  "routes": [
    {
      "title":"1st test route",
      "points": [
        {"s":"Wolf 906","label":"My home"},
        {"s":"Checkpoint 1"},
        {"s":"Checkpoint 2","label":"Great discovery here"},
        {"s":"Checkpoint 3"},
        {"s":"Sagittarius A*","label":"Center of the galaxy"}
      ]
    },
    {
      "title":"2nd test route",
      "points": [
        {"s":"Checkpoint 4"},
        {"s":"Checkpoint 5"},
        {"s":"Checkpoint 6"}
      ]
    }
  ]
}

ed3d-galaxy-map's People

Contributors

anthornet avatar gbiobob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ed3d-galaxy-map's Issues

Scale is always set as distanceFromTarget which doesn't work if target isn't where user is zooming in

Scale appears determined by distanceFromTarget (line 697 ed3dmap.js). However, it is possible to manually move the camera and zoom in with the mouse wheel, thus zooming in on an area very far from the target. The result of this is that the user can zoom in on an area and all stars will disappear because they are so far from the target they become minimum size.

see:
http://gerdofal.net/ed/ed3dmap/plotedsm.php

Z-fighting on the marker

Link to image

There seems to be z-fighting (or x,y whatever) of the black marker inside.

Don't know 3D, but you may know how to fix it?

Display System names by default

It would be nice if there was an option to display system names by default instead of having to click

More technically: where would you add code to make that one work? Maybe I give it a look

Possible issue with the display

Hi biobob, first off thanks for this, it looks and works really well. However there appears to be either an issue with the display or an issue with frontiers galaxy generation.

If you check the map of known neutron stars on my site http://www.spansh.co.uk/map.html then you will note that barring one or two very close to the bubble, there appears to be almost no neutron stars (discovered) along the 0 axis (What I will call Z) heading between Sol/Sag A/Colonia. There is another less obvious (because there are less Neutron stars) gap on the X axis.

Now, it may simply be that people haven't discovered them there and that they are there, however given the amount of stars displayed either side there it seems unlikely.

As such I "think" you may have a perspective/rendering issue around the 0 axis markers pushing stars a little too far away from them. If not then it could genuinely be an issue with Frontiers stellar forge but I thought I'd look at the most obvious option first.

(Seperately I'm having a few small issues dropping this into a non full screen modal but I'm sure I can work that out on my own, it would however be really useful if I could specify the height/width in pixels on the initialise call, I may see if I can submit a pull request later this week that add's that if you're interested).

EDIT: I am being informed by someone who is able to get in game that it might actually be that there are no neutron stars on that axis and the problem may lie within frontiers "stellar forge", as such I have added a post to see if I can get feedback from the devs https://forums.frontier.co.uk/showthread.php/320436-Possible-issue-with-the-stellar-forge?p=4985341#post4985341

Put ed3dmap.js code into IIFE

Lots of global vars and functions right now, making it difficult to truly "refresh" or "destroy" (a la angular directive).

I will start working on a PR to move the code into an IIFE.

scaleSize has no effect in systems js

Changes to the scale size:

'scaleSize' : 64,

have no effect in

system.class.js

I've tried playing around with it a bit on my machine and I've had no luck trying to get it to have any impact on the final output at all. Looking at where it is used, I get the impression that it's being applied to a property that may require an x, y, and z scale instead?

Suggestion - Add progress bar while loading huge JSON

It would be great if we could have a progress bar, or even a spinning wheel and a loading message, while loading a huge JSON. That edsm.json I make every night takes even a good browser on a good connection a while to load it. (Delay only noticeable on first visit to the page each day.)

Typo: cusor instead of cursor

Hi there,

There is a consistent typo with "cusor" instead of "cursor" - "r" is missing:

# grep -ir cusor js/components/

js/components/action.class.js: this.addCusorOnHover(sel.x, sel.y, sel.z);
js/components/action.class.js: this.addCusorOnSelect(goX, goY, goZ);
js/components/action.class.js: 'addCusorOnSelect' : function (x, y, z) {
js/components/action.class.js: 'addCusorOnHover' : function (x, y, z) {

Bower/NPM packages

Would you mind setting them up for easier consumption into other projects?

How can I get rid of the wide spread particles based on the galaxy image?

For a small project, I customized the galaxy image "textures/heightmap7.jpg" to fit my needs.
Everything went quiet fine, but I find the "fog" or "particles" generated in a distance somewhat annoying.

Is there a (simple) way to omit the generation of these particles?

thanks in advance
Grimmer Schnitter

Zooming in manually doesn't really zoom in low levels

So the problem is when you zoom in without clicking on a system, scrolling the map becomes unbearingly slow (scale modificator or something?) and the systems as well as the ring around a hovered star. I can never zoom to the level which you can achieve by clicking on a star.

Example:
Link

Happens if you tilt the view to look sideways and the til it back to normal.

Weirdly enough, when this state is reached, the left mouse button rotates the camera's view and not the galaxy. It seems the focal position is almost near the camera. Any idea?

Licence?

Hi there,

I'm interested in forking / basing off your project. Can you put down a licence file so that I can know what I should be doing when considering whether I have to keep it open source, release contributions, etc?

Thanks!

New feature request: dynamic reload

Is it possible to trigger a reload of the map data from JSON without taking the map off the screen? Just adding the new points? And maybe taking away points, or re-categorizing points, that aren't needed any more?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.