Salut,

je bosse en ce moment sur un projet qui à pour but final d'afficher une carte en 2D/3D d'un univers.

Pour le moment j'essaye de reproduire une map 2D pour comprendre les méthode d'affichage et l'interprétation des données.
Le rendu "test" souhaité :







Les données :
Je récupère les coordonnées via une base de données, les champs X,Y de type DOUBLE.

- exemple :
X= -8.85107925999806e+016
Y= 4.23694439668789e+016


Mon problème :
Je ne sais pas par où commencer et comment interpréter ces données pour les dessiner. J'ai donc essayer simplement avec les méthodes Draw, DrawLine, DrawImageUnscaled tiré d'une classe trouvée sur le net :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
 
namespace EveMapD
{
    class Plot
    {
        //class to plot x and y values on a form
        //
        //because on the form coordinates start at the upper left corner with 0,0
        //with the y coordinate going down, a little transformation is done here
        //so that x,y coordinates act as normal carthesian coordinates, with 0,0
        //in the center of the form
 
        struct PlotPort
        {
            public int minX;
            public int maxX;
            public int minY;
            public int maxY;
        };
 
        private PlotPort _PlotW;    //"window" of carthesian coordinates
        private Size _ClientArea;   //keeps the pixels info
        private double _Xspan;
        private double _Yspan;
 
        public Plot() { }
 
        public Plot(Size Plotarea)
        {
            _ClientArea = Plotarea;
        }
 
        public Size ClientArea { set { _ClientArea = value; } }
 
        public void SetPlotPort(int minx, int maxx, int miny, int maxy)
        {
            //set the bounderies of the form(screen) to real coordinates.
            _PlotW.minX = minx;
            _PlotW.maxX = maxx;
            _PlotW.minY = miny;
            _PlotW.maxY = maxy;
            _Xspan = _PlotW.maxX - _PlotW.minX;
            _Yspan = _PlotW.maxY - _PlotW.minY;
        }
 
        public void PlotPixel(double X, double Y, Color C, Graphics G)
        {
            //workhorse of this class
            Bitmap bm = new Bitmap(1, 1);
            bm.SetPixel(0, 0, C);
            G.DrawImageUnscaled(bm, Convert.ToInt32(TX(X)), Convert.ToInt32(TY(Y)));
        }
 
        private double TX(double X) //transform real coordinates to pixels for the X-axis
        {
            double w;
            w = _ClientArea.Width / _Xspan * X + _ClientArea.Width / 2;
            //return Convert.ToInt32(w);
            return w;  
        }
 
        private double TY(double Y) //transform real coordinates to pixels for the Y-axis
        {
            double w;
            w = _ClientArea.Height / _Yspan * Y + _ClientArea.Height / 2;
 
            //return Convert.ToInt32(w);
            return w;
        }
    }
}
Un soucis survient lors de l'utilisation de la fonction PlotPixel() et des valeurs récupérées dans la base de données passées en paramètres (nombre trop grand pour int).

Comment puis-je m'y prendre ? je suis preneur de toute autre solution et je suis conscient que cette classe n'est pas forcément adaptée (maybe..).

Merci pour vos futur réponse, j'espère avoir été clair, je suis sur que comme d'habitude, ça ne doit pas être si compliqué que ça..