FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Gestion d'un système client-serveur.
Un p'tit cube Emptypar Klaus Ven 17 Mai 2024 - 14:02

» item_index(résolu)
Un p'tit cube Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
Un p'tit cube Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
Un p'tit cube Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Un p'tit cube Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
Un p'tit cube Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
Un p'tit cube Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
Un p'tit cube Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
Un p'tit cube Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
Un p'tit cube Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
Un p'tit cube Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
Un p'tit cube Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
Un p'tit cube Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Un p'tit cube Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
Un p'tit cube Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -28%
Précommande : Smartphone Google Pixel 8a 5G ...
Voir le deal
389 €

 

 Un p'tit cube

Aller en bas 
3 participants
AuteurMessage
JL35




Nombre de messages : 7095
Localisation : 77
Date d'inscription : 29/11/2007

Un p'tit cube Empty
MessageSujet: Un p'tit cube   Un p'tit cube EmptyMer 9 Fév 2022 - 9:11

Juste un gadget...
Pour dessiner un parallélépipède rectangle en perspective (cas particulier un cube)
Paramètres: emplacement, dimensions de la face avant (et arrière), décalage de la face arrière
par rapport à la face avant.
Code:
DIM x0,y0,e,d,x1,y1,x2,y2,x3,y3,x4,y4,w,h,dx,dy
PICTURE 1: FULL_SPACE 1: 2D_TARGET_IS 1: 2D_PEN_WIDTH 2
w = 300: h = 140: x0 = 100: y0 = 260
dx = 80: ' décalage horizontal (à droite)
dy = -80: ' décalage vertical (en haut)
Cube3D(x0,y0,w,h,dx,dy)
w = 300: h = 40: x0 = 100: y0 = 60
dx = 80: ' décalage horizontal (à droite)
dy = 80: ' décalage vertical (en bas)
Cube3D(x0,y0,w,h,dx,dy)
END

SUB Cube3D(x0,y0,w,h,dx,dy)
  ' Dessin en x0,y0 sur la cible 2D d'un cube ou parallélépipède rectangle en 3D
  ' Dimensions face w x h, décalage face arrière H = dx, V = dy (>0 ou <0)
  ' Trait, couleur: paramètres courants
  DIM_LOCAL x(2,4),y(2,4),i
  x(1,1) = x0: x(1,2) = x0+w: x(1,3) = x0+w: x(1,4) = x0
  y(1,1) = y0: y(1,2) = y0: y(1,3) = y0+h: y(1,4) = y0+h
  FOR i = 1 TO 4: x(2,i) = x(1,i)+dx: y(2,i) = y(1,i)+dy: NEXT i
  IF dy < 0 THEN 2D_LINE x(2,1),y(2,1),x(2,2),y(2,2): ' face arrière
  IF dx > 0 THEN 2D_LINE x(2,2),y(2,2),x(2,3),y(2,3)
  IF dy > 0 THEN 2D_LINE x(2,3),y(2,3),x(2,4),y(2,4)
  IF dx < 0 THEN 2D_LINE x(2,4),y(2,4),x(2,1),y(2,1)
  ' arêtes
  IF dy > 0
      2D_LINE x(1,3),y(1,3),x(2,3),y(2,3): 2D_LINE x(1,4),y(1,4),x(2,4),y(2,4)
      IF dx > 0 THEN 2D_LINE x(1,2),y(1,2),x(2,2),y(2,2): ELSE: 2D_LINE x(1,1),y(1,1),x(2,1),y(2,1)
  ELSE
      2D_LINE x(1,1),y(1,1),x(2,1),y(2,1): 2D_LINE x(1,2),y(1,2),x(2,2),y(2,2)
      IF dx > 0 THEN 2D_LINE x(1,3),y(1,3)-1,x(2,3),y(2,3)-1: ELSE: 2D_LINE x(1,4),y(1,4),x(2,4),y(2,4)
  END_IF
  2D_RECTANGLE x(1,1),y(1,1),x(1,3),y(1,3): ' face avant
END_SUB
Un p'tit cube Boite10
Revenir en haut Aller en bas
jjn4

jjn4


Nombre de messages : 2709
Date d'inscription : 13/09/2009

Un p'tit cube Empty
MessageSujet: Re: Un p'tit cube   Un p'tit cube EmptyVen 11 Fév 2022 - 16:44

Superbe, JL35 !
Il ne manque plus que le papier cadeau,
avec le ruban et le noeud
et ça sera parfait !
lol!
Revenir en haut Aller en bas
http://jjn4.e-monsite.com
Marc

Marc


Nombre de messages : 2397
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Un p'tit cube Empty
MessageSujet: Re: Un p'tit cube   Un p'tit cube EmptyVen 11 Fév 2022 - 17:57

Bravo et merci JL35 pour le partage !
Revenir en haut Aller en bas
Contenu sponsorisé





Un p'tit cube Empty
MessageSujet: Re: Un p'tit cube   Un p'tit cube Empty

Revenir en haut Aller en bas
 
Un p'tit cube
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» The Cube
» Projet d'un Rubik's cube en 3D
» cube avec belle texture
» Jeu des ptit chvaux
» ptit bug dans panoramic

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: