Hey, I was just trying to make a cube (paint it onto the form)...

It worked, but is there anyway to make it dynamic?

I can paint the illusion of 3D on a form, but I'd like to make it so I can rotate it around etc, right now I'm doing it like this, but there's still problems..

My cube starts looking funny if I change iVertX = -20, or iVertY = -20 or both, etc.. it changes shape lol

Does anyone know how to do this more dynamically, only changing a few variables (X Y Z axis) to change it's position?

Code:

Code:
        Dim _iX As Integer = Me.Width \ 2
        Dim _iY As Integer = Me.Height \ 2
        Dim iVertX As Integer = 20
        Dim iVertY As Integer = 20
        Dim iW As Integer = 120
        Dim iH As Integer = 120
        If iVertX >= 0 Then
            If iVertY >= 0 Then
                e.Graphics.DrawLine(Pens.Black, New Point(_iX, _iY), New Point(_iX, _iY + (iH - iVertY)))
            Else
                e.Graphics.DrawLine(Pens.Black, New Point(_iX, _iY), New Point(_iX, _iY + (iH)))
            End If
        Else
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + (iW - iVertX), _iY), New Point(_iX + (iW - iVertX), _iY + (iH - iVertY)))
        End If
        e.Graphics.DrawLine(Pens.Black, New Point(_iX, _iY), New Point(_iX + (iW - iVertX), _iY))
        e.Graphics.DrawLine(Pens.Black, New Point(_iX + (iW - iVertX), _iY), New Point(_iX + iW, _iY + iVertY))

        e.Graphics.DrawLine(Pens.Black, New Point(_iX, _iY), New Point(_iX + iVertX, _iY + iVertY))
        If iVertX >= 0 Then
            If iVertY >= 0 Then
                e.Graphics.DrawLine(Pens.Black, New Point(_iX, _iY + (iH - iVertY)), New Point(_iX + iVertX, _iY + iH))
            Else
                e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW, _iY + (iH + iVertY)), New Point(_iX + iW - iVertX, _iY + iH))
            End If
        Else
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW - iVertX, _iY + (iH - iVertY)), New Point(_iX + iW, _iY + iH))
        End If
        If iVertY >= 0 Then
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iVertX, _iY + iH), New Point(_iX + iVertX, _iY + iVertY))
        Else
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW - iVertX, _iY + iH), New Point(_iX + iW + -iVertX, _iY))
        End If

        e.Graphics.DrawLine(Pens.Black, New Point(_iX + iVertX, _iY + iVertY), New Point(_iX + iW, _iY + iVertY))
        If iVertY >= 0 Then
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW, _iY + iVertY), New Point(_iX + iW, _iY + iH))
        Else
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW, _iY + iVertY), New Point(_iX + iW, _iY + iH + iVertY))
        End If
        If iVertY >= 0 Then
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW, _iY + iH), New Point(_iX + iVertX, _iY + iH))
        Else
            e.Graphics.DrawLine(Pens.Black, New Point(_iX + iW - iVertX, _iY + iH), New Point(_iX, _iY + iH))
        End If
Cheers
Icyculyr