Re: Mes polygons
Publié : jeu. 18/nov./2010 19:18
Ba oui, depuis la video du jeu trouvable sur le netdjes a écrit :Comment t'as fait? T'as repompé les originaux?

Ba oui, depuis la video du jeu trouvable sur le netdjes a écrit :Comment t'as fait? T'as repompé les originaux?
Alors dobro, as tu reussi a voir l'anim grace au code que j'ai mis sur la page precedente ?SPH a écrit :Attention, fais a l'arrache mais ca rend bien :
http://xmas.free.fr/pb/anotherworld.zip
![]()
Pardon ... oui oui !SPH a écrit : Alors dobro, as tu reussi a voir l'anim grace au code que j'ai mis sur la page precedente ?
glBegin(GL_TRIANGLES)
glColor3f(r,g,b,ALPHA)
glVertex3f(...
glVertex3f(...
glVertex3f(...
glEnd()
Ma routine qui affiche la voiture another world :G-Rom a écrit :ta routine de rendu c'est quoi ?
si c'est en pure pb ca risque d'être chiant à gérer l'alpha.
En OpenGL par exemple :
glBegin(GL_TRIANGLES)
glColor3f(r,g,b,ALPHA)
glVertex3f(...
glVertex3f(...
glVertex3f(...
glEnd()
Code : Tout sélectionner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Another earth - RENDU
; SPH(2010)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
InitSprite()
InitKeyboard()
InitMouse()
#dw=1024
#dh=768
#dc=32
If OpenScreen(#dw,#dh,#dc,"Another Earth")=0
MessageRequester("Erreur", "Screen Open ("+Str(#dw)+","+Str(#dh)+",32) : impossible à ouvrir", 0) : End
EndIf
chm$="1.poly" : del=2500 : spr=-1 : Gosub poly
chm$="2.poly" : del=70 : spr=1 : Gosub poly
chm$="3.poly" : del=70 : spr=1 : Gosub poly
chm$="4.poly" : del=70 : spr=1 : Gosub poly
chm$="5.poly" : del=70 : spr=1 : Gosub poly
chm$="6.poly" : del=70 : spr=1 : Gosub poly
chm$="7.poly" : del=70 : spr=1 : Gosub poly
chm$="8.poly" : del=70 : spr=1 : Gosub poly
chm$="9.poly" : del=70 : spr=1 : Gosub poly
chm$="10.poly" : del=70 : spr=1 : Gosub poly
chm$="11.poly" : del=70 : spr=1 : Gosub poly
chm$="12.poly" : del=70 : spr=1 : Gosub poly
chm$="13.poly" : del=70 : spr=1 : Gosub poly
chm$="14.poly" : del=70 : spr=1 : Gosub poly
chm$="15.poly" : del=70 : spr=1 : Gosub poly
chm$="16.poly" : del=70 : spr=1 : Gosub poly
chm$="17.poly" : del=1200 : spr=1: Gosub poly
chm$="18.poly" : del=70 : spr=1 : Gosub poly
Repeat
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
End
poly:
If spr=1
DisplaySprite(0,0,0)
EndIf
If OpenFile(0, chm$) ; Ouvre un fichier existant ou en crée un nouveau s'il n'existait pas
l=Lof(0)
If l<=0
Debug("Fichier vide")
End
EndIf
l/2
Dim bank.w(l)
For i=0 To l
bank(i)=ReadWord(0)
Next
CloseFile(0)
EndIf
temps = ElapsedMilliseconds()
; For i=0 To l
; Debug bank(i)
; Next
; For i=0 To ici_bank+4
; Debug bank(i)
; Next
; End
la=1
For i=1 To bank(0)
u=bank(la)
; Dim ps2.Point(nb-1) ; Array of 5 POINT structures
la+1
If bank(la)<>-1
Debug "bank<>-1":End
EndIf
la+1
rvb=RGB(bank(la),bank(la+1),bank(la+2))
la+3
Dim ps2.Point(u) ; Array of 5 POINT structures
For p=0 To u
ps2(p)\x=bank(la):la+1
ps2(p)\y=bank(la):la+1
Next p
hDC=StartDrawing(ScreenOutput())
Box(0,0,0,0,rvb) ; Would be nice to have a Cls() facility !!!
SetWindowOrgEx_(hDC,00,00,#Null) ; Move origin downwards
Polygon_(hDC,@ps2(0),u+1)
StopDrawing()
Next
If spr=-1
GrabSprite(0,0,0,#dw,#dh)
EndIf
;temps = ElapsedMilliseconds()-temps
FlipBuffers()
Delay(del)
Return