Je suppose que c'est possible. Mais ma question a un enjeux plus important. Une question qui m'indiquera si je peux faire ce que je veux avec ogre : peut on trier les faces d'un paquet de triangles pour afficher ceux qui sont devant ?comtois a écrit :Non, on peut faire des trucs comme ça, mais afficher un simple triangle avec Ogre c'est pas possibleSPH a écrit :Peut on egalement afficher un simple triangle en 3D dans ogre ?
Apprendre les routines 3D
Re: Apprendre les routines 3D
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Apprendre les routines 3D
ca se fait tout seul avec le moteur 3D, c'est pour ca que c'est pratique !!
_________________________________________________
Mon site : CeriseCode (Attention Chantier perpétuel )
Mon site : CeriseCode (Attention Chantier perpétuel )
Re: Apprendre les routines 3D
Bin, je veux faire une demo oldschool et j'ai l'impression que ogre ne fait que du tres compliqué...
Bon, je vais me pencher sur ogre alors...
Bon, je vais me pencher sur ogre alors...
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Apprendre les routines 3D
Sérieux...SPH a écrit :Peut on egalement afficher un simple triangle en 3D dans ogre ?
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Re: Apprendre les routines 3D
Oui, serieuxAr-S a écrit :Sérieux...SPH a écrit :Peut on egalement afficher un simple triangle en 3D dans ogre ?
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Apprendre les routines 3D
Tiens un vieux code que j'avais fait et posté ici :
Code : Tout sélectionner
Structure World3D
x.f
y.f
z.f
EndStructure
Global Dim Point3D.World3D(8)
Global Dim Point2D.World3D(8)
Global Dim Sommet.World3D(8)
#Xoff = 512
#Yoff = 384
#Zoff = 250
Global Dim Matrice.f(3,3)
; /****************************************************************************/
; /* Rotation() : effectue la rotation des points Sommets -> Point3D */
; /****************************************************************************/
Procedure Rotation(Xa.f,Ya.f,Za.f)
matrice(0,0) = Cos(Za)*Cos(Ya)
matrice(1,0) = Sin(Za)*Cos(Ya)
matrice(2,0) = -Sin(Ya)
matrice(0,1) = Cos(Za)*Sin(Ya)*Sin(Xa) - Sin(Za)*Cos(Xa)
matrice(1,1) = Sin(Za)*Sin(Ya)*Sin(Xa) + Cos(Xa)*Cos(Za)
matrice(2,1) = Sin(Xa)*Cos(Ya)
matrice(0,2) = Cos(Za)*Sin(Ya)*Cos(Xa) + Sin(Za)*Sin(Xa)
matrice(1,2) = Sin(Za)*Sin(Ya)*Cos(Xa) - Cos(Za)*Sin(Xa)
matrice(2,2) = Cos(Xa)*Cos(Ya)
For i = 0 To 7
Point3D(i)\x = matrice(0,0)*Sommet(i)\x + matrice(1,0)*Sommet(i)\y + matrice(2,0)*Sommet(i)\z
Point3D(i)\y = matrice(0,1)*Sommet(i)\x + matrice(1,1)*Sommet(i)\y + matrice(2,1)*Sommet(i)\z
Point3D(i)\z = matrice(0,2)*Sommet(i)\x + matrice(1,2)*Sommet(i)\y + matrice(2,2)*Sommet(i)\z
Next i
EndProcedure
; /****************************************************************************/
; /* Projection() : projette en perspective les points après rotation. */
; /****************************************************************************/
Procedure Projection()
For i = 0 To 7
Point2D(i)\x=(Point3D(i)\x*256)/(Point3D(i)\z+#Zoff)+#Xoff;
Point2D(i)\y=(Point3D(i)\y*256)/(Point3D(i)\z+#Zoff)+#Yoff;
Next i
EndProcedure
; /****************************************************************************/
; /* Initialiser() : initialise les coordonnees des sommets du cube */
; /****************************************************************************/
Procedure Initialiser()
Sommet(0)\x = -100 : Sommet(0)\y = -100 : Sommet(0)\z = -100
Sommet(1)\x = 100 : Sommet(1)\y = -100 : Sommet(1)\z = -100
Sommet(2)\x = 100 : Sommet(2)\y = 100 : Sommet(2)\z = -100
Sommet(3)\x = -100 : Sommet(3)\y = 100 : Sommet(3)\z = -100
Sommet(4)\x = 100 : Sommet(4)\y = -100 : Sommet(4)\z = 100
Sommet(5)\x = -100 : Sommet(5)\y = -100 : Sommet(5)\z = 100
Sommet(6)\x = -100 : Sommet(6)\y = 100 : Sommet(6)\z = 100
Sommet(7)\x = 100 : Sommet(7)\y = 100 : Sommet(7)\z = 100
EndProcedure
Procedure ligne(a.l,b.l,couleur.l)
LineXY(Point2D(a)\x,Point2D(a)\y,Point2D(b)\x,Point2D(b)\y,couleur);
EndProcedure
Procedure Update()
Static Couleur.l
Couleur = RGB(100,100,255)
StartDrawing(ScreenOutput())
For i = 0 To 7
Circle(Point2D(i)\x,Point2D(i)\y,3,Couleur)
;
; Locate(Point2D(i)\x,Point2D(i)\y)
; DrawText(Str(i))
;
;
ligne(0,1,couleur)
ligne(1,2,couleur)
ligne(2,3,couleur)
ligne(3,0,couleur)
ligne(4,5,couleur)
ligne(5,6,couleur)
ligne(6,7,couleur)
ligne(7,4,couleur)
ligne(0,5,couleur)
ligne(1,4,couleur)
ligne(2,7,couleur)
ligne(3,6,couleur)
Next i
StopDrawing()
EndProcedure
InitSprite () : InitKeyboard () : InitMouse ()
OpenScreen (1024,768,32, "" )
Initialiser()
Repeat
ExamineKeyboard () : ExamineMouse() : ClearScreen (0)
Xangle.f + 0.01
Yangle.f + 0.03
ZAngle.f + 0.01
Rotation(Xangle,Yangle,Zangle)
Projection()
Update()
FlipBuffers ()
Until KeyboardPushed ( #PB_Key_Escape )
Re: Apprendre les routines 3D
Superbe code !
Re: Apprendre les routines 3D
J'adooore
Je cherchais un code 3D qui accentue la profondeur et la, je suis servi. Encore bravo !!
Je cherchais un code 3D qui accentue la profondeur et la, je suis servi. Encore bravo !!
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: Apprendre les routines 3D
Le principe de la 3D est relativement simple.
tu as une liste de points 3D qui représente ton objet sans les transformation ( rotation, position, échelle )
tu appliques ensuite des transformations de ces points par le biais de calcul via des matrices, le résultat te donne des points 3D "transformé" , tu as donc 2 listes de points, les point de l'objet non transformé , les points de l'objet tranformé.
il reste une dernière transformation à faire , la projection à l'écran. ton écran est un plan 2D , tu dois donc projeter tes points 3D dessus , il en ressortira des points 2D ( les coordonnée en pixel sur ton écran ) , y a plus qu'a dessiné.
Le code plus haut à une dizaine d'année , je m'étais inspiré de christophe heulin quand j'apprennais la 3D : http://103683.free.fr/3dtut/Plan3D.html
tu as une liste de points 3D qui représente ton objet sans les transformation ( rotation, position, échelle )
tu appliques ensuite des transformations de ces points par le biais de calcul via des matrices, le résultat te donne des points 3D "transformé" , tu as donc 2 listes de points, les point de l'objet non transformé , les points de l'objet tranformé.
il reste une dernière transformation à faire , la projection à l'écran. ton écran est un plan 2D , tu dois donc projeter tes points 3D dessus , il en ressortira des points 2D ( les coordonnée en pixel sur ton écran ) , y a plus qu'a dessiné.
Le code plus haut à une dizaine d'année , je m'étais inspiré de christophe heulin quand j'apprennais la 3D : http://103683.free.fr/3dtut/Plan3D.html
Re: Apprendre les routines 3D
Ca a l'air interessant. Je le liraisG-Rom a écrit : http://103683.free.fr/3dtut/Plan3D.html
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
-
- Messages : 2194
- Inscription : jeu. 27/janv./2005 19:07
Re: Apprendre les routines 3D
La même chose chez celui-ci en moins orthodoxe au niveau de la présentation!
Est beau ce qui plaît sans concept
Speedy Galerie
Speedy Galerie
Re: Apprendre les routines 3D
Ligne 92 en décommettant le drawtext et en le remplaçant par :
L'effet est sympa
Code : Tout sélectionner
DrawText(Point2D(i)\x,Point2D(i)\y,Str(i))
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels