Jump to content
Sign in to follow this  

GlPluginUtils OpenGL

Recommended Posts


Here is just some camera rotation code I thought I might share for the non mathematical coders. First thing this does is rotate around the object in the center of the screen. Once you've successfully logged in (Global Success = 3) It moves the rotating object to the top right corner of the screen. In other words, it rotates the camera target! as at a different degree than the camera to achieve the illusion of a rotating object on the screen that you can move anywhere you want.

Func RotateLeft(ByRef $x, ByRef $z, Byref $dX, ByRef $dY, ByRef $dZ, ByRef $CameraDistance, ByRef $Degree)
    $Degree += 1
    $Rdn = _Radian($Degree)
    $x = Cos($Rdn) * $CameraDistance
    $z = Sin($Rdn) * $CameraDistance
    If $Success = 3 Then
        If $Degree2 < 45 Then
            $Degree2 += 0.4
            $Rdn2 = _Radian($Degree2)
            $CameraDistance += 2
            $dY -= 0.6
    $dX = Cos($Rdn + $Rdn2) * ($CameraDistance - 150)
    $dZ = Sin($Rdn + $Rdn2) * ($CameraDistance - 150)

SetCamera($x, $y, $z, $dX, $dY, $dZ)

The next snippet of code that I'd like to share is just to create the Umbrella Corp. logo easily. You all know it by now, from the Resident Evil movies and games. I used the global variables to make the object easier to manipulate as a group since I didn't make an array to store the different values. It basically creates 8 objects for an octogon... and the variable $Object has a new value each time the Function runs.

Global $y = 0
Global $x = 0
Global $z = 30

Global $sx1 = 0
Global $sx2 = 3.3
Global $sx3 = -3.3

Global $sy1 = 0
Global $sy2 = 8
Global $sy3 = 8

Global $sz1 = 1
Global $sz2 = 1
Global $sz3 = 1

Global $Object

$i = 0

$R = 0.7
$G = 0
$B = 0

For $i = 0 to 270 Step 90
    CObj($i, $R, $G, $B)

$R = 1
$G = 1
$B = 1

For $i = 45 to 315 Step 90
    CObj($i, $R, $G, $B)
SetCamera($x, $y, $z, 0, 0, 0)

Func CObj(ByRef $Rotation, ByRef $R, ByRef $G, ByRef $B)
    $Object = ObjectCreate()
    $Triangle1 = AddTriangle($Object, $sx1, $sy1, $sz1, $sx2, $sy2, $sz2, $sx3, $sy3, $sz3, 1, 2, 0, $R, $G, $B, 1.0)
    $Triangle2 = AddTriangle($Object, $sx1, $sy1, $sz1 - 1, $sx2 * (-1), $sy2, $sz2 - 1, $sx3 * (-1), $sy3, $sz3 - 1, 1, 2, 0, $R, $G, $B, 1.0)
    $Cube1 = AddCube( $Object, 6.5, 0, 1, $R, $G, $B, 1.0)
    ShapeTranslate( $Object, $Cube1, $sx3 + 3.25, $sy3, $sz3 - 0.5 )
    $Cube2 = AddCube( $Object, 0, 8.5, 1, $R, $G, $B, 1.0)
    ShapeTranslate( $Object, $Cube2, $sx2/2, $sy2/2, $sz2 - 0.5 )
    ShapeRotate( $Object, $Cube2, 0, 0, -22)
    $Cube3 = AddCube( $Object, 0, 8.5, 1, $R, $G, $B, 1.0)
    ShapeTranslate( $Object, $Cube3, $sx3/2, $sy3/2, $sz3 - 0.5)
    ShapeRotate( $Object, $Cube3, 0, 0, 22)

    ObjectRotate( $Object, 0, 0,  $Rotation)

Share this post

Link to post
Share on other sites

Here is the project that I've been messing around with for the last week. There is some code in the UmbrellaCorp.au3 that modifies your Registry. I've commented it out but if you're not comfortable with code that modifies your registry, please don't run it. And don't blame me if you do and it messes something up on your computer.

By the way... The whole concept of this project was to create a cool mock interface for a fictional company.


Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.