IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage Delphi Discussion :

Problème de modélisation sur Delphi


Sujet :

Langage Delphi

  1. #1
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2014
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2014
    Messages : 3
    Points : 1
    Points
    1
    Par défaut Problème de modélisation sur Delphi
    Bonjour,
    je rencontre un petit problème sur Delphi: j'ai modélisé un pont et celui ci doit se lever. Or, j'arrive à faire bouger les trois lignes qui représentent le pont mais pas le polygone qui représente l’extrémité du pont ,et dont le mouvement doit être synchronisé avec celui-ci (question de réalisme). Auriez vous des idées à me proposer? J'ai joint une image du problème ainsi que les lignes de code. Nom : Modélisation.JPG
Affichages : 165
Taille : 130,4 Ko


    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
    // Création des six lignes modélisant le pont
     
    var
      Form1: TForm1;
      t,z,etape,loop,q:integer;
       x1,y1,l1,m1,a1,b1,c1,d1,e1,f1,g1,h1,w0,w1,w2,w3,w4,w5,b:integer;
       mouvement:integer=0;
     
       const
       x0=180;
       y0=397;
       r=258;
     
       l0=160;
       m0=408;
       r1=266;
     
       a0=161;
       b0=449;
       r2=266;
     
       c0=740;
       d0=397;
       r3=305;
     
       e0=730;
       f0=408;
       r4=305;
     
       g0=729;
       h0=449;
       r5=306;
     
    //Permet de faire bouger chaque ligne du pont
     
    implementation
     
    uses Unit2, Unit3;
    procedure tform1.timer1timer(sender:tobject);
    begin
     
     
                   x1:=round(x0+r*cos(t));
                   y1:=round(y0+w0*sin(100));
                   moveto(x0,y0);
                   lineto(x1-z,y1-z);
     
                   l1:=round(l0+r1*cos(t));
                   m1:=round(m0+w1*sin(100));
                   moveto(l0,m0);
                   lineto(l1-z,m1-z);
     
                   a1:=round(a0+r2*cos(t));
                   b1:=round(b0+w2*sin(100));
                   moveto(a0,b0);
                   lineto(a1-z,b1-z);
     
                   c1:=round(c0+r3*-cos(t));
                   d1:=round(d0+w3*sin(100));
                   moveto(c0,d0);
                   lineto(c1+z,d1-z);
     
                   e1:=round(e0+r4*-cos(t));
                   f1:=round(f0+w4*sin(100));
                   moveto(e0,f0);
                   lineto(e1+z,f1-z);
     
                   g1:=round(g0+r5*-cos(t));
                   h1:=round(h0+w5*sin(100));
                   moveto(g0,h0);
                   lineto(g1+z,h1-z);
     
    // Polygone représentant l'extrémité du pont
     
    polygon([point(418,408),point(439,398),point(439,441),point(419,449)]);

  2. #2
    Expert éminent
    Avatar de Lung
    Profil pro
    Analyste-programmeur
    Inscrit en
    Mai 2002
    Messages
    2 664
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Analyste-programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 2 664
    Points : 6 959
    Points
    6 959
    Par défaut
    Petite question :
    Pourquoi ne pas utiliser des bibliothèques (comme OpenGL) dont c'est le rôle (de faire de la 3D), plutôt que de réinventer la roue ?
    (Je suis d'accord que ça peut avoir aussi un intérêt à faire les choses par soi-même)
    L'urgent est fait, l'impossible est en cours, pour les miracles prévoir un délai. ___ Écrivez dans un français correct !!

    C++Builder 5 - Delphi 6#2 Entreprise - Delphi 2007 Entreprise - Delphi 2010 Architecte - Delphi XE Entreprise - Delphi XE7 Entreprise - Delphi 10 Entreprise - Delphi 10.3.2 Entreprise - Delphi 10.4.2 Entreprise - Delphi 11.1 Entreprise
    OpenGL 2.1 - Oracle 10g - Paradox - Interbase (XE) - PostgreSQL (15.4)

  3. #3
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    euh...tu calcules déjà 3 des points formants l'extrémité du pond...il ne reste qu'à calculer le quatrième et dessiner le polygone
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    var
      p: array[0..3] of TPoint;
    begin
      ...
      p[0].x := round(c0+r3*-cos(t));
      p[0].y := ...
      p[1].x := ...
     
      polygon(p);
    end;
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  4. #4
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2014
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2014
    Messages : 3
    Points : 1
    Points
    1
    Par défaut
    Bonjour,
    Merci pour la réponse ,cependant après avoir intégré les lignes de code, et crée le polygone, cela ne marche toujours pas . Voici les lignes de code (les lignes que j'ai intégrées selon vos conseils commencent à partir de la ligne 175).

    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
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls, StdCtrls, jpeg;
     
    type
      TForm1 = class(TForm)
        Image1: TImage;
        Timer1: TTimer;
        Button7: TButton;
        Button8: TButton;
        Button9: TButton;
        Image2: TImage;
        Timer2: TTimer;
        Image3: TImage;
        Timer3: TTimer;
        Timer4: TTimer;
        Timer5: TTimer;
        bateau: TImage;
        Timer6: TTimer;
        Button2: TButton;
        procedure timer1timer(sender:tobject);
        procedure Button9Click(Sender: TObject);
        procedure Timer2Timer(Sender: TObject);
     
     
        procedure Button7Click(Sender: TObject);
        procedure Button8Click(Sender: TObject);
        procedure Timer3Timer(Sender: TObject);
        procedure Timer4Timer(Sender: TObject);
        procedure bateauClick(Sender: TObject);
        procedure Timer6Timer(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
      //faire tourner la ligne (utiliser case pour symétrie)
     
    var
      Form1: TForm1;
      t,z,etape,loop,q:integer;
       x1,y1,l1,m1,a1,b1,c1,d1,e1,f1,g1,h1,w0,w1,w2,w3,w4,w5,b:integer;
       mouvement:integer=0;
       p: array[0..3] of TPoint;
     
       const
       x0=180;
       y0=397;
       r=258;
     
       l0=160;
       m0=408;
       r1=266;
     
       a0=161;
       b0=449;
       r2=266;
     
       c0=740;
       d0=397;
       r3=305;
     
       e0=730;
       f0=408;
       r4=305;
     
       g0=729;
       h0=449;
       r5=306;
     
     
     
     
    implementation
     
    uses Unit2, Unit3;
    procedure tform1.timer1timer(sender:tobject);
    begin
     
    with form1.image1.canvas do
    begin
    fillrect(clientrect);
     
                  Pen.width:=2;
                  Pen.Color:=clpurple;
     
     
                  //délimitation terre-mer
     
                  brush.Color := rgb(0,237,0);
                  polygon([point(0,270),point(214,270),point(0,483)]);
                   brush.Color := rgb(255,255,255);
     
                   brush.Color := rgb(90,213,255);
                  polygon([point(214,270),point(1017,270),point(781,767),point(0,767),point(0,483)]);
                   brush.Color := rgb(255,255,255);
     
                   brush.Color := rgb(0,237,0);
                  polygon([point(1017,270),point(1350,270),point(1350,767),point(781,767)]);
                  brush.Color := rgb(255,255,255);
     
                   brush.Color := rgb(143,157,179);
                  polygon([point(0,270),point(1350,270),point(1350,0),point(0,0)]);
                  brush.Color := rgb(255,255,255);
     
                     //voiture
     
                  polygon([point(196+b,400),point(255+b,400),point(255+b,380), point(196+b,380)]);
                  if mouvement=2 then
                  case etape of
     
                  0:begin
                  b:=b+1;
                  if (b>1) then
                  etape:=1;
                  end;
     
                  1:begin
                  b:=b+1;
                  if (b>200) then
                  etape:=2;
                  end;
     
                  end;
     
                        //bateau
     
                    brush.Color := rgb(149,100,222);
                  polygon([point(749+t,668),point(903+t,668),point(941+t,621),point(694+t,621)]);
                  polygon([point(823+t,620),point(823+t,532)]);
                  polygon([point(823+t,582),point(859+t,582),point(824+t,549)]);
                    brush.Color := rgb(255,255,255);
     
     
                  //faire bouger une ligne précise
     
     
                   x1:=round(x0+r*cos(t));
                   y1:=round(y0+w0*sin(100));
                   moveto(x0,y0);
                   lineto(x1-z,y1-z);
     
                   l1:=round(l0+r1*cos(t));
                   m1:=round(m0+w1*sin(100));
                   moveto(l0,m0);
                   lineto(l1-z,m1-z);
     
                   a1:=round(a0+r2*cos(t));
                   b1:=round(b0+w2*sin(100));
                   moveto(a0,b0);
                   lineto(a1-z,b1-z);
     
                   c1:=round(c0+r3*-cos(t));
                   d1:=round(d0+w3*sin(100));
                   moveto(c0,d0);
                   lineto(c1+z,d1-z);
     
                   e1:=round(e0+r4*-cos(t));
                   f1:=round(f0+w4*sin(100));
                   moveto(e0,f0);
                   lineto(e1+z,f1-z);
     
                   g1:=round(g0+r5*-cos(t));
                   h1:=round(h0+w5*sin(100));
                   moveto(g0,h0);
                   lineto(g1+z,h1-z);
     
     
      p[0].x := round(x0+r*cos(t));
      p[0].y := round(y0+w0*sin(100));
      p[1].x := round(l0+r1*cos(t));
      p[1].y := round(m0+w1*sin(100));
      p[2].x := round(a0+r2*cos(t));
      p[2].y := round(b0+w2*sin(100));
     
                     // polygone de l'extremité du pont
                    polygon([point(418,408),point(439,398),point(439,441),point(419,449)]);
     
     
                  //tour partie gauche
     
                  //colonnes
     
                  brush.Color := rgb(149,200,222);
                  polygon([point(46,493),point(160,493),point(160,407),point(46,407)]);
                  polygon([point(46,415),point(160,415)]);
                  polygon([point(160,493),point(184,486),point(184,403),point(160,407)]);
                  polygon([point(46,407),point(57,400)]);
                  polygon([point(57,407),point(77,407),point(77,182),point(57,182)]);
                  polygon([point(57,182),point(77,182),point(77,156),point(57,156)]);
                  polygon([point(57,162),point(77,162)]);
                  polygon([point(138,407),point(160,407),point(157,182),point(138,182)]);
                  polygon([point(138,182),point(157,182),point(156,157),point(138,157)]);
                  polygon([point(138,161),point(156,161)]);
                  polygon([point(168,177),point(180,172),point(179,147),point(168,149)]);
                  polygon([point(168,155),point(179,154)]);
                  polygon([point(156,169),point(168,165)]);
                   brush.Color := rgb(255,255,255);
     
                  //toits partie gauche
     
                  brush.Color := rgb(149,200,222);
                  polygon([point(57,156),point(77,156),point(67,102)]);
                  polygon([point(138,157),point(156,157),point(147,101)]);
                  polygon([point(168,149),point(179,147),point(172,96)]);
                  polygon([point(77,169),point(123,71),point(123,71),point(144,115),point(138,157),point(138,169)]);
                  polygon([point(152,130),point(168,160),point(168,178),point(157,182),point(156,157),point(152,130)]);
     
                   brush.Color := rgb(255,255,255);
                   polygon([point(116,84),point(129,84)]);
                   polygon([point(156,168),point(168,165)]);
     
     
                     //murs frontaux
     
                          brush.Color := rgb(149,200,222);
                  polygon([point(138,169),point(77,169)]);
                  polygon([point(180,172),point(157,182)]);
     
                  polygon([point(184,403),point(180,172)]);
                  polygon([point(77,169),point(138,169),point(138,407),point(77,407)]);
                  polygon([point(160,407),point(183,403),point(180,172),point(157,182)]);
     
                           brush.Color := rgb(255,255,255);
                           polygon([point(77,299),point(138,299)]);
                            polygon([point(77,182),point(138,182)]);
                            polygon([point(157,299),point(180,294)]);
     
                  //fenetres partie gauche
     
                  brush.Color := rgb(0,0,108);
                  polygon([point(84,387),point(97,387),point(97,329),point(84,329)]);
                  polygon([point(115,387),point(128,387),point(128,329),point(115,329)]);
                  polygon([point(84,276),point(97,276),point(97,218),point(84,218)]);
                  polygon([point(115,277),point(128,277),point(128,219),point(115,219)]);
     
                  polygon([point(160,387),point(164,383),point(164,326),point(160,332)]);
                  polygon([point(172,386),point(176,380),point(176,326),point(172,330)]);
                  polygon([point(160,277),point(164,273),point(164,216),point(160,220)]);
                  polygon([point(172,276),point(176,271),point(176,214),point(172,219)]);
                  brush.Color := rgb(255,255,255);
     
     
                  //antennes
     
                  polygon([point(67,102),point(67,80)]);
                  polygon([point(147,101),point(147,82)]);
                  polygon([point(123,71),point(123,43)]);
                  polygon([point(172,97),point(172,80)]);
     
     
     
                  //tour partie droite
     
                  //fondation
     
                   brush.Color := rgb(149,200,222);
                  polygon([point(729,493),point(843,493),point(843,407),point(729,407)]);
                  polygon([point(729,415),point(843,415)]);
                  polygon([point(843,493),point(867,485),point(867,401),point(843,407)]);
                  polygon([point(843,415),point(867,410)]);
                  polygon([point(729,407),point(740,401)]);
                  polygon([point(160,415),point(184,412)]);
                   brush.Color := rgb(255,255,255);
     
                  //colonnes
     
                  brush.Color := rgb(149,200,222);
                  polygon([point(740,407),point(760,407),point(760,182),point(740,182)]);
                  polygon([point(740,182),point(760,182),point(760,156),point(740,156)]);
                  polygon([point(740,162),point(760,162)]);
     
                  polygon([point(821,407),point(840,407),point(840,182),point(821,182)]);
                  polygon([point(821,182),point(840,182),point(839,157),point(821,157)]);
                  polygon([point(821,161),point(839,161)]);
     
                  polygon([point(851,178),point(862,174),point(862,147),point(851,149)]);
                  polygon([point(851,155),point(862,153)]);
                   brush.Color := rgb(255,255,255);
     
                  //toits partie droite
     
                  brush.Color := rgb(149,200,222);
                  polygon([point(740,156),point(760,156),point(750,102)]);
                  polygon([point(821,157),point(839,157),point(830,101)]);
                  polygon([point(851,149),point(862,147),point(855,99)]);
                  polygon([point(760,169),point(806,71),point(827,115),point(821,157),point(821,169),point(821,407),point(760,407),point(760,169)]);
                  polygon([point(835,130),point(851,160)]);
                  polygon([point(798,84),point(812,84)]);
                  polygon([point(806,71),point(806,43)]);
                   brush.Color := rgb(255,255,255);
     
                   //murs frontaux
     
                   brush.Color := rgb(149,200,222);
                  polygon([point(863,403),point(862,174)]);
                  polygon([point(760,299),point(821,299)]);
                  polygon([point(760,182),point(821,182)]);
                  polygon([point(760,169),point(821,169)]);
                   polygon([point(835,130),point(839,157),point(840,407),point(863,403),point(862,174),point(851,178),point(851,160),point(835,130)]);
     
     
                   brush.Color := rgb(255,255,255);
                   polygon([point(840,299),point(863,293)]);
                   polygon([point(840,182),point(862,174)]);
                   polygon([point(839,169),point(851,164)]);
     
                  //fenetres partie droite
     
                  brush.Color := rgb(0,0,108);
                  polygon([point(767,387),point(780,387),point(780,329),point(767,329)]);
                  polygon([point(798,387),point(811,387),point(811,329),point(798,329)]);
                  polygon([point(767,276),point(780,276),point(780,218),point(767,218)]);
                  polygon([point(798,277),point(811,277),point(811,219),point(798,219)]);
     
                  polygon([point(843,387),point(847,383),point(847,327),point(843,331)]);
                  polygon([point(843,277),point(847,274),point(847,217),point(843,221)]);
                  polygon([point(855,386),point(859,381),point(859,326),point(855,330)]);
                  polygon([point(855,276),point(859,270),point(859,215),point(855,219)]);
                   brush.Color := rgb(255,255,255);
     
     
                  //antennes
     
                  polygon([point(750,102),point(750,80)]);
                  polygon([point(830,101),point(830,81)]);
                  polygon([point(855,99),point(855,81)]);
     
     
     
                  //pont partie haut
     
                  brush.Color := rgb(149,200,222);
                  polygon([point(180,191),point(740,191),point(740,199),point(157,199),point(180,191)]);
                  polygon([point(157,199),point(740,199),point(740,215),point(157,215)]);
                  polygon([point(157,215),point(740,215)]);
                   brush.Color := rgb(255,255,255);
     
                  //panneau
     
                  brush.Color := rgb(149,100,222);
                  polygon([point(410,215),point(465,215),point(465,185),point(410,185)]);
                    brush.Color := rgb(255,255,255);
     
     
     
        brush.color:=clwhite;
    end;
    end;
     
    {$R *.dfm}
     
    procedure TForm1.Button9Click(Sender: TObject);
    begin
    form1.close;
    end;
     
    procedure TForm1.Timer2Timer(Sender: TObject);
    begin
    image2.Left:= image2.Left-30;
    if (image2.Left<-100) then image2.Left:=1100;
    end;
     
     
     
     
     
    procedure TForm1.Button7Click(Sender: TObject);
    begin
    form2.show
    end;
     
    procedure TForm1.Button8Click(Sender: TObject);
    begin
    form3.show
    end;
     
    procedure TForm1.Timer3Timer(Sender: TObject);
    begin
     
     
    mouvement:=0;
     
     
     if mouvement=0 then
     
     
                   case etape of
                   0:begin
                   z:=z+10;
                   if(z=150)then
                   etape:=1;
     
                    end;
     
       end;
     
    end;
     
     
    procedure TForm1.Timer4Timer(Sender: TObject);
    begin
     
    begin
    mouvement:=1;
            if mouvement=1 then
            case etape of
                    1:begin
                   z:=z-5;
                   if(z=0)then
                   etape:=2;
                   end;
                   end;
     
    end;
    end;
     
    procedure TForm1.bateauClick(Sender: TObject);
    begin
    bateau.Visible:=true;
    bateau.Top:=209;
    bateau.Left:=72;
     
    end;
     
    procedure TForm1.Timer6Timer(Sender: TObject);
    begin
     bateau.Left:=bateau.Left-2;
        bateau.Top:=bateau.Top+3;
        if (bateau.Top<269) then bateau.Top:=268;
        if (bateau.Left> 800 )then bateau.Left:=409;
     
    end;
     
    procedure TForm1.Button2Click(Sender: TObject);
    begin
    mouvement:=2;
    begin
                  b:=b+20;
     
                  end;
     
     
    end;
     
    end.

  5. #5
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    p[0].x := round(x0+r*cos(t));
      p[0].y := round(y0+w0*sin(100));
      p[1].x := round(l0+r1*cos(t));
      p[1].y := round(m0+w1*sin(100));
      p[2].x := round(a0+r2*cos(t));
      p[2].y := round(b0+w2*sin(100));
     
                     // polygone de l'extremité du pont
                    polygon([point(418,408),point(439,398),point(439,441),point(419,449)]);
    ce doit être une blague, c'est pour caméra cachée belge c'est ça ? ils sont trop fort pour faire des gags les belges
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  6. #6
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2014
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2014
    Messages : 3
    Points : 1
    Points
    1
    Par défaut
    Non, non, je vous assure, ce n'est pas une blague J'ai beau avoir integré votre code et le polygone ne bouge toujours pas d'un centimètre... (cela peut aussi etre du au fait que je sois débutant sur Delphi...)

  7. #7
    Modérateur

    Homme Profil pro
    Ingénieur retraité
    Inscrit en
    Octobre 2005
    Messages
    2 396
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur retraité

    Informations forums :
    Inscription : Octobre 2005
    Messages : 2 396
    Points : 3 263
    Points
    3 263
    Par défaut
    Bonjour,

    les lignes que j'ai intégrées selon vos conseils commencent à partir de la ligne 175
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Ligne 175 p[0].x := round(x0+r*cos(t));
              p[0].y := round(y0+w0*sin(100));
              p[1].x := round(l0+r1*cos(t));
              p[1].y := round(m0+w1*sin(100));
              p[2].x := round(a0+r2*cos(t));
              p[2].y := round(b0+w2*sin(100));
     
                             // polygone de l'extremité du pont
    Ligne 183               polygon([point(418,408),point(439,398),point(439,441),point(419,449)]);
    Si p[0] à p[3] sont les points de l'extrémité du pont alors le polygone de l'extremité du pont c'est polygon([p[0], p[1], p[2], p[3]]) et non le polygone des constantes en rouge.
    En plus il manque le calcul de p[3].

    A+.
    N'oubliez pas de consulter les FAQ Delphi et les cours et tutoriels Delphi

  8. #8
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    Citation Envoyé par Gilbert Geyer Voir le message
    Bonjour,



    Si p[0] à p[3] sont les points de l'extrémité du pont alors le polygone de l'extremité du pont c'est polygon([p[0], p[1], p[2], p[3]]) et non le polygone des constantes en rouge.
    En plus il manque le calcul de p[3].

    A+.
    ou plus simplement Polygon(p) comme donné dans mon code
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  9. #9
    Rédacteur/Modérateur
    Avatar de Andnotor
    Inscrit en
    Septembre 2008
    Messages
    5 677
    Détails du profil
    Informations personnelles :
    Localisation : Autre

    Informations forums :
    Inscription : Septembre 2008
    Messages : 5 677
    Points : 13 082
    Points
    13 082
    Par défaut
    C'est surtout ces 100 radians qui piquent les yeux

Discussions similaires

  1. Problème installation jvcl sur Delphi xe5
    Par Pierre95 dans le forum Débuter
    Réponses: 9
    Dernier message: 11/01/2014, 13h24
  2. [Delphi 6] Problème de debug sur un ActiveX
    Par Hypollite76 dans le forum Langage
    Réponses: 13
    Dernier message: 16/12/2009, 14h32
  3. Réponses: 1
    Dernier message: 06/07/2006, 19h20
  4. Problème de "cxControls.dcu" no found sur Delphi 5
    Par Clemsou dans le forum Langage
    Réponses: 2
    Dernier message: 16/08/2005, 12h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo