Voilà, j'ai un problème car dans ce sujet ici, je sollicite l'aide des utilisateurs de Linux.
Est-ce que quelqu'un, s'il-vous-plaît (au moins 2 personnes, ce serait bien) pourrait vérifier le code de STARGÅTE que je vais poster ci-dessous?
Le but est de bien regarder la texture pendant la rotation et voir si cette texture vous semble réaliste ou pas.
Il y a 3 possibilités de réponse:
1) Les 2 textures sont identiques et légèrement tordues
2) Les 2 textures sont différentes et l'une d'entre elles est tordue, alors que l'autre est bien formée
3) Les 2 textures sont identiques et bien formées
Code : Tout sélectionner
; Auteur : STARGÅTE
InitSprite()
InitSprite3D()
InitMouse()
InitKeyboard()
OpenWindow(0, 0, 0, 800, 600, "Screen", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)
CreateSprite(1, 64, 64, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
Box(0, 0, 64, 64, $808080)
For x = 0 To 7
For y = 0 To 7
If (x+y)%2 : Box(x*8, y*8, 8, 8, $FFFFFF) : EndIf
Next
Next
StopDrawing()
CreateSprite3D(1, 1)
Repeat
ExamineMouse()
ClearScreen(0)
#HalfSize = 150
#Distance = 500
Start3D()
a.f + MouseDeltaX() / 50.0
z1.f = #Distance-Sin(a)*#HalfSize : z4.f=z1
z2.f = #Distance+Sin(a)*#HalfSize : z3.f=z2
x1.f = -Cos(a)*#HalfSize : x4.f=x1
x2.f = Cos(a)*#HalfSize : x3.f=x2
j.f = (#HalfSize/#Distance) * #HalfSize
y1.f = -#HalfSize-Sin(a)*j : y2.f=-#HalfSize+Sin(a)*j
y3.f = #HalfSize-Sin(a)*j : y4.f=#HalfSize+Sin(a)*j
TransformSprite3D(1, x1,y1, x2,y2, x3,y3, x4,y4)
DisplaySprite3D(1, 200, 300)
TransformSprite3D(1, x2,y2, x1,y1, x4,y4, x3,y3)
DisplaySprite3D(1, 200, 300)
TransformSprite3D(1, x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4)
DisplaySprite3D(1, 600, 300)
TransformSprite3D(1, x2,y2,z2, x1,y1,z1, x4,y4,z4, x3,y3,z3)
DisplaySprite3D(1, 600, 300)
Stop3D()
StartDrawing(ScreenOutput())
DrawText(100,50,"3D-rotation without parameter z")
DrawText(500,50,"3D-rotation with parameter z")
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)