Jump to content

3D Rendering: Perspective graphics (Make far things look smaller)


algiuxas
 Share

Recommended Posts

Hello,

I need help with perspective graphics, I made orthographic 3D renderer, now I want to make it perspective:
OrtographicsR.thumb.png.bcd30a5d6ea793a1

I have made functions that might help:
- _3DGetPos($PosX,$PosY,$PosZ) (To get 3D position, output is array with X and Y positions)

- _3DGetDistance($PosX,$PosY,$PosZ, [$CameraPosX, $CameraPosY, $CameraPosZ] ) (Gets distance between positions)

- _DrawCubeSolidColor( $Color, $PosX, $PosY, $PosZ, $SizeX, $SizeY, $SizeZ ) (I rendered 4 cubes if you see in the picture)

I tried to make things smaller if they are far with this in _3DGetPos(...):
 $Output[0] = ($Output[0]*(1/_3DGetDistance($PosX,$PosY,$PosZ)(Gets distance between camera and position)) + $PosXReal(This makes everything shown in center of GUI)
 $Output[1] = ($Output[1]*(1/_3DGetDistance($PosX,$PosY,$PosZ))) + $PosXReal

What I get:

Ortographics.thumb.png.1d5bc19e5547f96f9

Weird... What to do?

Thanks :)

(Sorry for my bad English.)

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
Share on other sites

#cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.14.2
    Author:         Algiuxas

    Script Function:
    3D RENDERING

Look(rotate camera) with:
     W
    ASD
Go up and down with: + and -
Move with:
    UP, DOWN, LEFT, RIGHT buttons.



#ce ----------------------------------------------------------------------------

#include <GDIPlus.au3>
#include <Math.au3>
#include <Misc.au3>
#include <Array.au3>
#include <GUIConstants.au3>

Global $Title = "3D Orthographics/Perspective AutoIt (by Algiuxas)"
Global $Display_Width = 600
Global $Display_Height = 400
Global $GUI = GUICreate($Title, $Display_Width, $Display_Height, -1, -1, -1, -1, 0)

Global Const $PI = 3.14159;26535897932384626433832795
Global Const $PI2 = $PI / 2
Global Const $2PI = $PI * 2
Global Const $5PI = $PI * 1.5
Global Const $fDegToRad = $PI / 180

Global $Size = ($Display_Width + $Display_Height) / 10, $CameraPosX = 0, $CameraPosY = 0, $CameraPosZ = 0

#Region# GDIPlus
_GDIPlus_Startup()
Global $Graphics = _GDIPlus_GraphicsCreateFromHWND($GUI)
Global $Bitmap = _GDIPlus_BitmapCreateFromGraphics($Display_Width, $Display_Height, $Graphics)
Global $GfxCtxt = _GDIPlus_ImageGetGraphicsContext($Bitmap)
_GDIPlus_GraphicsSetSmoothingMode($GfxCtxt, 2)
#EndRegion# GDIPlus
#Region# Colors ( 0x AA RR GG BB )
Global Const $Color_DisplayBackground = 0xFF000000
Global Const $Pen_White = _GDIPlus_PenCreate(0xFFFFFFFF, 1)
Global Const $Pen_X = _GDIPlus_PenCreate(0xFFFF0000, 3)
Global Const $Pen_Y = _GDIPlus_PenCreate(0xFF00FF00, 3)
Global Const $Pen_Z = _GDIPlus_PenCreate(0xFF0000FF, 3)
Global Const $Pen_Demo = _GDIPlus_PenCreate(0xFF777700, 2)
Global Const $Brush_White = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
Global Const $Brush_Trans = _GDIPlus_BrushCreateSolid(0x80FFFFFF)
#EndRegion# Colors ( 0x AA RR GG BB )
#Region# Camera
Global $Camera_MinusWatch = 15
Global $CameraPosX = 0
Global $CameraPosY = 0
Global $CameraPosZ = 0
Global $CameraRotationX = Random(0,359,1)
Global $CameraRotationY = Random(180-30,180+30,1)
Global $CameraRotationZ = 0
#EndRegion# Camera

GUISetState(@SW_SHOW)
Do
    _GDIPlus_GraphicsClear($GfxCtxt, $Color_DisplayBackground/3)
    _GDIPlus_GraphicsDrawString( $GfxCtxt, $CameraPosX, 10,10)
    _GDIPlus_GraphicsDrawString( $GfxCtxt, $CameraPosY, 10,30)
    _GDIPlus_GraphicsDrawString( $GfxCtxt, $CameraPosZ, 10,50)
    $Size = ($Display_Width + $Display_Height) / 10
    $CameraRotationX -= 0.05
    If _IsPressed(57) Then $CameraRotationY += 3;W
    If _IsPressed(53) Then $CameraRotationY -= 3;S
    If _IsPressed(41) Then $CameraRotationX += 3;A
    If _IsPressed(44) Then $CameraRotationX -= 3;D

    If _IsPressed("6B") Then $CameraPosY -= 0.05
    If _IsPressed("6D") Then $CameraPosY += 0.05

    $MoveX = 0
    $MoveZ = 0
    If _IsPressed(26) Then $MoveX -= 0.05;<-
    If _IsPressed(28) Then $MoveX += 0.05;->
    If _IsPressed(27) Then $MoveZ -= 0.05;/\
    If _IsPressed(25) Then $MoveZ += 0.05;\/
    If $MoveX <> 0 then
        $CameraPosX += Round(Sin(_Radian($CameraRotationX))*$MoveX,3)
        $CameraPosZ += Round(Cos(_Radian($CameraRotationX))*$MoveX,3)
    EndIf
    If $MoveZ <> 0 then
        $CameraPosX += Round(Sin(_Radian($CameraRotationX-90))*$MoveZ,3)
        $CameraPosZ += Round(Cos(_Radian($CameraRotationX-90))*$MoveZ,3)
    EndIf
    $CameraPosX += 0
    $CameraPosY += 0
    $CameraPosZ += 0
    If $CameraRotationY < 90+$Camera_MinusWatch then $CameraRotationY = 90+$Camera_MinusWatch
    If $CameraRotationY > 270-$Camera_MinusWatch then $CameraRotationY = 270-$Camera_MinusWatch
    _DrawCubeSolidColor(0x7000FF00,0,0,0)
    _DrawCubeSolidColor(0x70FF0000,1,0,0)
    _DrawCubeSolidColor(0x700000FF,0,0,1)
    _DrawCubeSolidColor(0x70FFFFFF,0,1,1)
    _GDIPlus_GraphicsDrawImage($Graphics, $Bitmap, 0, 0)
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func _DrawCubeSolidColor($Color = 0x70FFFFFF, $PosX = -0.5, $PosY = -0.5, $PosZ = -0.5, $SizeX = 1, $SizeY = 1, $SizeZ = 1)
    $SizeX += $PosX
    $SizeY += $PosY
    $SizeZ += $PosZ
    $Pos000 = _3DGetPos($SizeX, $SizeY, $SizeZ)
    $Pos100 = _3DGetPos($PosX, $SizeY, $SizeZ)
    $Pos010 = _3DGetPos($SizeX, $PosY, $SizeZ)
    $Pos001 = _3DGetPos($SizeX, $SizeY, $PosZ)
    $Pos011 = _3DGetPos($SizeX, $PosY, $PosZ)
    $Pos110 = _3DGetPos($PosX, $PosY, $SizeZ)
    $Pos101 = _3DGetPos($PosX, $SizeY, $PosZ)
    $Pos111 = _3DGetPos($PosX, $PosY, $PosZ)
    Local $Brush_SolidLocal = _GDIPlus_BrushCreateSolid($Color)
    _GDIPlus_GraphicsDrawLine($GfxCtxt, $Pos000[0], $Pos000[1], $Pos001[0], $Pos001[1], $Pen_X)
    _GDIPlus_GraphicsDrawLine($GfxCtxt, $Pos000[0], $Pos000[1], $Pos010[0], $Pos010[1], $Pen_Y)
    _GDIPlus_GraphicsDrawLine($GfxCtxt, $Pos000[0], $Pos000[1], $Pos100[0], $Pos100[1], $Pen_Z)
    _DrawRectSide($Brush_SolidLocal, $SizeX,$SizeY,$SizeZ, $PosX,$SizeY,$SizeZ, $PosX,$PosY,$SizeZ, $SizeX,$PosY,$SizeZ)
    _DrawRectSide($Brush_SolidLocal, $PosX,$SizeY,$PosZ, $SizeX,$SizeY,$PosZ, $SizeX,$PosY,$PosZ, $PosX,$PosY,$PosZ)
;~  _DrawRect($Brush_SolidLocal, $PosX,$SizeY,$PosZ, $SizeX,$SizeY,$PosZ, $SizeX,$PosY,$PosZ, $PosX,$PosY,$PosZ)
;~  _DrawPoint(Color(0,0xFFFFFFFF,1),$PosX,$PosY,$PosZ,16)
;~  _DrawPoint(Color(0,0xFFFFFFFF,3),$PosX,$PosY,$SizeZ,32)
;~  _DrawPoint(Color(0,0xFFFFFFFF,2),$PosX,$SizeY,$PosZ,8)
;~  _DrawPoint(Color(0,0xFFFFFFFF,4),$PosX,$SizeY,$SizeZ,4)
    _DrawRectSide($Brush_SolidLocal, $PosX,$PosY,$SizeZ, $PosX,$PosY,$PosZ, $PosX,$SizeY,$PosZ, $PosX,$SizeY,$SizeZ)
    _DrawRectSide($Brush_SolidLocal, $SizeX,$PosY,$PosZ, $SizeX,$PosY,$SizeZ, $SizeX,$SizeY,$SizeZ, $SizeX,$SizeY,$PosZ)
    _DrawRectTop($Brush_SolidLocal, $PosX,$SizeY,$PosZ, $SizeX,$SizeY,$PosZ, $SizeX,$SizeY,$SizeZ, $PosX,$SizeY,$SizeZ)

EndFunc   ;==>_DrawCubeSolidColor
Func _DrawRectTop($Brush, $PosX0 = 0, $PosY0 = 0, $PosZ0 = 0, $PosX1 = 1, $PosY1 = 0, $PosZ1 = 0, $PosX2 = 1, $PosY2 = 1, $PosZ2 = 0, $PosX3 = 0, $PosY3 = 1, $PosZ3 = 0)
    $RotationDegX = DegreesNormalize(-$CameraRotationX)
    $RotationDegY = DegreesNormalize(-$CameraRotationY)
    $RotationDegZ = DegreesNormalize(-$CameraRotationZ)
;~  If _IsOnDisplay2PointsOneSide($PosX0, $PosY0, $PosZ0, $PosX1, $PosY1, $PosZ1) = True or _IsOnDisplay2PointsOneSide($PosX3, $PosY3, $PosZ3, $PosX2, $PosY2, $PosZ2) = True Then
        $Pos1 = _3DGetPos($PosX0, $PosY0, $PosZ0)
        $Pos2 = _3DGetPos($PosX1, $PosY1, $PosZ1)
        $Pos3 = _3DGetPos($PosX2, $PosY2, $PosZ2)
        $Pos4 = _3DGetPos($PosX3, $PosY3, $PosZ3)
        Local $aPoints[5][2]
        $aPoints[0][0] = 4
        $aPoints[1][0] = $Pos1[0]
        $aPoints[2][0] = $Pos2[0]
        $aPoints[3][0] = $Pos3[0]
        $aPoints[4][0] = $Pos4[0]
        $aPoints[1][1] = $Pos1[1]
        $aPoints[2][1] = $Pos2[1]
        $aPoints[3][1] = $Pos3[1]
        $aPoints[4][1] = $Pos4[1]
        _GDIPlus_GraphicsFillPolygon($GfxCtxt, $aPoints, $Brush)
;~  EndIf
EndFunc   ;==>_DrawRect
Func _DrawRectSide($Brush, $PosX0 = 0, $PosY0 = 0, $PosZ0 = 0, $PosX1 = 1, $PosY1 = 0, $PosZ1 = 0, $PosX2 = 1, $PosY2 = 1, $PosZ2 = 0, $PosX3 = 0, $PosY3 = 1, $PosZ3 = 0)
    $RotationDegX = DegreesNormalize(-$CameraRotationX)
    $RotationDegY = DegreesNormalize(-$CameraRotationY)
    $RotationDegZ = DegreesNormalize(-$CameraRotationZ)
    If _IsOnDisplay2PointsOneSide($PosX0, $PosY0, $PosZ0, $PosX1, $PosY1, $PosZ1) = True or _IsOnDisplay2PointsOneSide($PosX3, $PosY3, $PosZ3, $PosX2, $PosY2, $PosZ2) = True Then
        $Pos1 = _3DGetPos($PosX0, $PosY0, $PosZ0)
        $Pos2 = _3DGetPos($PosX1, $PosY1, $PosZ1)
        $Pos3 = _3DGetPos($PosX2, $PosY2, $PosZ2)
        $Pos4 = _3DGetPos($PosX3, $PosY3, $PosZ3)
        Local $aPoints[5][2]
        $aPoints[0][0] = 4
        $aPoints[1][0] = $Pos1[0]
        $aPoints[2][0] = $Pos2[0]
        $aPoints[3][0] = $Pos3[0]
        $aPoints[4][0] = $Pos4[0]
        $aPoints[1][1] = $Pos1[1]
        $aPoints[2][1] = $Pos2[1]
        $aPoints[3][1] = $Pos3[1]
        $aPoints[4][1] = $Pos4[1]
        _GDIPlus_GraphicsFillPolygon($GfxCtxt, $aPoints, $Brush)
    EndIf
EndFunc   ;==>_DrawRect
Func _DrawPoint($Pen, $PosX0 = 0, $PosY0 = 0, $PosZ0 = 0,$Size=4)
        $Pos = _3DGetPos($PosX0, $PosY0, $PosZ0)
        _GDIPlus_GraphicsDrawEllipse($GfxCtxt,$Pos[0]-$Size/2,$Pos[1]-$Size/2,$Size,$Size,$Pen)
EndFunc   ;==>_DrawRect
Func _DrawLine($Pen, $PosX0 = 0, $PosY0 = 0, $PosZ0 = 0, $PosX1 = 0, $PosY1 = 0, $PosZ1 = 0)
        $Pos0 = _3DGetPos($PosX0, $PosY0, $PosZ0)
        $Pos1 = _3DGetPos($PosX1, $PosY1, $PosZ1)
        _GDIPlus_GraphicsDrawLine($GfxCtxt, $Pos0[0], $Pos0[1], $Pos1[0], $Pos1[1], $Pen)
EndFunc   ;==>_DrawRect
Func _IsOnDisplay2PointsOneSide($PosX0 = 0, $PosY0 = 0, $PosZ0 = 0, $PosX1 = 1, $PosY1 = 0, $PosZ1 = 0)
    $Pos1 = _3DGetPos($PosX0, $PosY0, $PosZ0)
    $Pos2 = _3DGetPos($PosX1, $PosY1, $PosZ1)
    $Rotation = GetAngle($Pos1[0],$Pos1[1],$Pos2[0],$Pos2[1])
    If $Rotation > 90 or $Rotation < -90 then
        Return True
    EndIf
    ;TODO!!!!!!!!!!!!
    Return False
EndFunc   ;==>_IsOnDisplay
Func _IsOnDisplay4PointsOneSide($PosX0 = 0, $PosY0 = 0, $PosZ0 = 0, $PosX1 = 1, $PosY1 = 0, $PosZ1 = 0, $PosX2 = 1, $PosY2 = 1, $PosZ2 = 0, $PosX3 = 0, $PosY3 = 1, $PosZ3 = 0)
    $Pos1 = _3DGetPos($PosX0, $PosY0, $PosZ0)
    $Pos2 = _3DGetPos($PosX1, $PosY1, $PosZ1)
    $Rotation = GetAngle($Pos1[0],$Pos1[1],$Pos2[0],$Pos2[1])
    If $Rotation < 90 and $Rotation > -90 then
        Return True
    EndIf
    ;TODO!!!!!!!!!!!!
    Return False
EndFunc   ;==>_IsOnDisplay
Func _3DGetDistance($PosX0,$PosY0,$PosZ0,$PosX1=$CameraPosX,$PosY1=$CameraPosY,$PosZ1=$CameraPosZ)
    $PosX0 -= $PosX1
    $PosY0 -= $PosY1
    $PosZ0 -= $PosZ1
    Return Sqrt($PosX0^2 + $PosY0^2 + $PosZ0^2)
EndFunc
Func _3DGetPos($PosX = 0, $PosY = 0, $PosZ = 0)
    Local $RotationX = _Radian(-$CameraRotationX)
    Local $RotationY = _Radian(-$CameraRotationY)
    Local $RotationZ = _Radian(-$CameraRotationZ)
    Local $Output[2] = [0, 0]
    Local $CosRotationX_M45 = Cos($RotationX - $PI2)
    Local $SinRotationX_M45 = Sin($RotationX - $PI2)
    Local $CosRotationX = Cos($RotationX)
    Local $SinRotationX = Sin($RotationX)
    Local $CosRotationY = Cos($RotationY)
    Local $SinRotationY = Sin($RotationY)
    Local $PosXReal = $Display_Width / 2
    Local $PosYReal = $Display_Height / 2
    $PosX -= $CameraPosX
    $PosY -= $CameraPosY
    $PosZ -= $CameraPosZ
; LOOK HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    $Output[0] = ( _
            Cos($RotationX) * $Size * $PosX + _ ;X: X
            0 * $PosY + _ ;Y: X
            Cos($RotationX - $PI / 2) * $Size * $PosZ) ;Z: X

    $Output[1] = ( _
            Sin($RotationX) * Sin($RotationY) * $Size * $PosX + _ ;X: Y
            Cos($RotationY) * $Size * $PosY + _ ;Y: Y
            Sin($RotationX - $PI / 2) * Sin($RotationY) * $Size * $PosZ) ;Z: Y
    ;TODO!!!!!!!!
    ;LOOK HERE!!!                       HERE                    HERE                HERE                HERE
    ;Perspective:
    $Output[0] = ($Output[0]*(1/_3DGetDistance($PosX,$PosY,$PosZ))) + $PosXReal
    $Output[1] = ($Output[1]*(1/_3DGetDistance($PosX,$PosY,$PosZ))) + $PosXReal
    ;Orthographics:
;~  $Output[0] = $Output[0] + $PosXReal
;~  $Output[1] = $Output[1] + $PosXReal
    Return $Output

EndFunc   ;==>_3DGetPos

Func DegreesNormalize($Degr)
    ;TODO!!!!!!!!!!!!!!!!!!!!!!!!! Maybe.

    Do
        If $Degr > 360 Then $Degr -= 360
        If $Degr < 0 Then $Degr += 360
    Until $Degr > -0.005 And $Degr < 360.005
    Return $Degr
EndFunc   ;==>DegreesNormalize

Func Color($ColorFunc01,$ColorFunc02,$ColorFunc03=1)
   ;$ColorFunc01 = Pen(0) or Brush(1)
   ;$ColorFunc02 = Color(Black,White,Orange,Yellow,Green,Blue,Red or Hex code)
   ;$ColorFunc03 = Pen width
   ;$ColorFunc04 = Color in Hex
   ;$ColorFuncOP = Pen or Brush OutPut

   ;Error codes:
   ;1001 = $ColorFunc01 invalid.
   ;1002 = $ColorFunc04 invalid lenght.

   ;Check and fix input to prevent errors:
   If $ColorFunc03 = "" then $ColorFunc03 = 1
   If $ColorFunc01 = "" then $ColorFunc01 = 1
   If $ColorFunc01 <> 1 and $ColorFunc01 <> 2 then Exit(1001&$ColorFunc01)
   If $ColorFunc02 = "" then $ColorFunc02 = "White"
   $ColorFunc02Orig = $ColorFunc02
   $ColorFunc02 = StringUpper($ColorFunc02)

   ;Convert $ColorFunc02 to Hex code:
   If       $ColorFunc02 = "BLACK" Then
            $ColorFunc04 = 0xFF000000
   ElseIf   $ColorFunc02 = "WHITE" Then
            $ColorFunc04 = 0xFFFFFFFF
   ElseIf   $ColorFunc02 = "ORANGE" Then
            $ColorFunc04 = 0xFFFF6600
   ElseIf   $ColorFunc02 = "YELLOW" Then
            $ColorFunc04 = 0xFFFFFF00
   ElseIf   $ColorFunc02 = "GREEN" Then
            $ColorFunc04 = 0xFF00FF00
   ElseIf   $ColorFunc02 = "BLUE" Then
            $ColorFunc04 = 0xFF0000FF
   ElseIf   $ColorFunc02 = "RED" Then
            $ColorFunc04 = 0xFFFF0000
   ElseIf   $ColorFunc02 <> "" Then
            $ColorFunc04 = $ColorFunc02orig
   EndIf

   ;Drawing with a Pen:
   If $ColorFunc01 = 1 Then
   Local $ColorFuncOP = _GDIPlus_PenCreate($ColorFunc04, $ColorFunc03)
   Endif

   ;Drawing with a Brush:
   If $ColorFunc01 = 2 Then
   Local $ColorFuncOP = _GDIPlus_BrushCreateSolid($ColorFunc04)
   Endif
   Return $ColorFuncOP
EndFunc

Func ATan2($y, $x)
    Return (2 * ATan($y / ($x + Sqrt($x * $x + $y * $y))))
EndFunc   ;==>ATan2
Func __GetDiagonal($__iDX, $__iDY)
    Return Sqrt($__iDX ^ 2 + $__iDY ^ 2)
EndFunc   ;==>__GetDiagonal
Func __GetDistance($iX1 = 0, $iY1 = 0, $iX2 = 0, $iY2 = 0)
;~  ConsoleWrite("__GetDistance( $iX1=" & $iX1 & ", $iY1=" & $iY1 & ", $iX2=" & $iX2 & ", $iY2=" & $iY2 & " )" & @LF)
    $__iDX = Abs($iX2 - $iX1)
    $__iDY = Abs($iY2 - $iY1)

    If Not $__iDX And Not $__iDY Then Return 0
    If Not $__iDX Then Return $__iDY
    If Not $__iDY Then Return $__iDX
    Return Sqrt($__iDX ^ 2 + $__iDY ^ 2)
EndFunc   ;==>__GetDistance
Func __SumAngles($iA1 = 0, $iA2 = 0, $iMode = 0)
    Switch $iMode
        Case 0
            $__iDA = $iA1 + $iA2
            While $__iDA >= $2PI
                $__iDA -= $2PI
            WEnd

            While $__iDA < 0
                $__iDA += $2PI
            WEnd
        Case Else
            $__iDA = $iA1 + $iA2
            While $__iDA >= 360
                $__iDA -= 360
            WEnd

            While $__iDA < 0
                $__iDA += 360
            WEnd
    EndSwitch
    Return $__iDA
EndFunc   ;==>__SumAngles
Func GetAngle($iX1 = 0, $iY1 = 0, $iX2 = 0, $iY2 = 0)
    $TempDegr = _Degree(__GetAngle($iX1, $iY1, $iX2, $iY2))
    $TempDegr = _Degree($TempDegr) * $fDegToRad
    Return ($TempDegr - $TempDegr - $TempDegr + 180)
EndFunc   ;==>GetAngle
Func __GetAngle($iX1 = 0, $iY1 = 0, $iX2 = 0, $iY2 = 0)
;~  ConsoleWrite(_Degree(__GetAngle(1, 1))-90)
;~  ConsoleWrite("__GetAngle( $iX1=" & $iX1 & ", $iY1=" & $iY1 & ", $iX2=" & $iX2 & ", $iY2=" & $iY2 & " )" & @LF)
    If $iX1 = $iX2 Then
        If $iY1 = $iY2 Then
            Return SetError(1, 0, -1)
        Else
            If $iY1 > $iY2 Then
                Return $PI / 2
            Else
                Return $5PI
            EndIf
        EndIf
    Else
        $__iDX = $iX2 - $iX1
        $__iDY = $iY2 - $iY1
        If $iX1 > $iX2 Then
            If $iY1 = $iY2 Then
                Return $PI
            Else
                If $iY1 > $iY2 Then
                    Return $PI2 + ATan($__iDX / $__iDY)
                Else
                    Return $5PI + ATan($__iDX / $__iDY)
                EndIf
            EndIf
        Else
            If $iY1 = $iY2 Then
                Return 0
            Else
                If $iY1 > $iY2 Then
                    Return $PI2 + ATan($__iDX / $__iDY)
                Else
                    Return $5PI + ATan($__iDX / $__iDY)
                EndIf
            EndIf
        EndIf
    EndIf
EndFunc   ;==>__GetAngle

@TheDcoder It's orthographic view, you will see in line 235 orthographic and perspective codes, remove semicolons(;) from two perspective lines and add to two orthographic lines semicolons

Look with WASD, move with up, down, left, right buttons, go up and down with + and - (- is up, + is down) :)

I forgot to fix one bug that I made... Cube walls are not in the right position... It should work now.

Edited by algiuxas

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
Share on other sites

I don't have any questions... because I don't understand your code. I just adviced you to post the code for others to help you :).

 

Although there is a bug (or is it intended behavior?) I noticed... The simulation does not look like 3D :blink:, but some clever image morphing or something :wacko:. My brain hurts! >_<

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Just now, TheDcoder said:

I don't have any questions... because I don't understand your code. I just adviced you to post the code for others to help you :).

 

Although there is a bug (or is it intended behavior?) I noticed... The simulation does not look like 3D :blink:, but some clever image morphing or something :wacko:. My brain hurts! >_<

Maybe you should try move back with down button. :) It' 3D, but...well...it's very buggy.

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...
On 2016-09-13 at 4:24 PM, TheDcoder said:

You did? Can I see the final result? :)

Oh no... I reinstalled my OS and now it's gone... But it wasn't good enought, I'LL MAKE A BETTER ONE! :D

I made huge mistakes in it, now I know how to make it :)

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
Share on other sites

1 minute ago, TheDcoder said:

Oh, I am sad :(... I will be waiting for a improved version though :D

Yeah, it WILL be much better, I have made it in C programming language, but yeah, I reinstalled OS...

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...