Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Using Truevision with AutoIt  (Read 786 times)
Dr.Doktor
Community Member
*
Posts: 2


« on: July 20, 2010, 04:00:26 PM »

Hi,
I try to use the Truevision SDK 6.5 with the language Autoit. I didn`t found any examples for it, but I thought that its possible to translate the visual basic example. The vb-script I found uses COM for communicate with the engine. Autoit support COM, also I started.
But now I have a problem in calling a method. My Interpreter says the following if .GetPosition() from the TVCamera class is called:
Quote
truevision_1.au3 (103) : ==> The requested action with this object has failed.:
$x = $oTVcamera.GetPosition()
$x = $oTVcamera.GetPosition()^ ERROR
The part of the code in Visual basic.net:
Code:
If inp.IsKeyPressed(TV_KEY_UP) Then
    camera.SetPosition camera.GetPosition.x, camera.GetPosition.y, camera.GetPosition.z - 1
End If

The same in Autoit:
First the part of code in which I instance the TVCamera object
Code:
$oTVcamera = ObjCreate("TV3D65.TVCamera")
With $oTVcamera
.SetViewFrustum(45, 10000)
.SetCamera(200, 500, 200, 0, 0, 0)
EndWith
And here the part where the error occurs:
Code:
If _IsPressed("26") Then ; up arrow key
$x = $oTVcamera.GetPosition()
ConsoleWrite("act x:" & $x)
$y = $oTVcamera.GetPosition.y() ; this fails to with the same error.
ConsoleWrite("act y:" & $y)
$z = $oTVcamera.GetPosition.z() ; ...
ConsoleWrite("act z:" & $z)
        $oTVcamera.SetPosition($x, $y, $z - 1)
EndIf
I use Win 7 Starter x86 and Autoit version 3.3.6.1.

The communication with the object generally seems to work great the log says nothing conspicuous for me:

Quote
07-20-2010 21:58:04 | --------------------------------------------
07-20-2010 21:58:04 | Truevision3D Debug/Log File
07-20-2010 21:58:04 | --------------------------------------------
07-20-2010 21:58:04 | Engine Version : 6.5
07-20-2010 21:58:04 | ENGINE INFO : DLL Compilation time Nov 11 2009 23:21:38
07-20-2010 21:58:04 | DEVICE INIT : Initialize Depth
07-20-2010 21:58:04 | DEVICE INIT : Initializing the device in fullscreen mode, with a render surface size of 800x600, format 22, depthbuffer 75
07-20-2010 21:58:06 | VIEWPORT MANAGER : Main viewport initialization
07-20-2010 21:58:06 | VIEWPORT MANAGER : Main viewport initialized (800x600)
07-20-2010 21:58:06 | DEVICE INIT : Initialization successful !
07-20-2010 21:58:06 | DEVICE INFO :  3D Card : Mobile Intel(R) 965 Express Chipset Family  | Card ID : 10754 | Driver ID : 657290
07-20-2010 21:58:06 | DEVICE INFO : Available texture memory : 245 MB
07-20-2010 21:58:06 | DEVICE INFO : Vertex Shaders 3.0 supported in hardware.
07-20-2010 21:58:06 | DEVICE INFO : Pixel Shaders 3.0 supported in hardware.
07-20-2010 21:58:06 | DEVICE INFO : Driver used is a DirectX9-level driver 'igdumdx32.dll'. Excellent
07-20-2010 21:58:06 | DEVICE INFO : Card Type Geforce6xxx/7xxx/8xxx/ATIRadeonX1xxx  Level card, third generation of programmable card
07-20-2010 21:58:07 | TEXTURE MANAGER : Loading of '2.jpg' successful '' on index 2
07-20-2010 21:58:07 | MESH TVM LOADER : Mesh 'plan_teren1.tvm' successfully loaded in 0 ms. 2 faces, 4 vertices, 1 groups
07-20-2010 21:58:07 | TEXTURE MANAGER : Successfully created a render surface 1024x1024 on slot 3
07-20-2010 21:58:07 | TEXTURE MANAGER : Successfully created a render surface 1024x1024 on slot 4
07-20-2010 21:58:44 | START UNLOAD
07-20-2010 21:58:46 | RESOURCE MANAGER : Engine successfully unloaded

Thanks in advice
Dr.Doktor

EDIT: It seems the communication with the object only works in 1 direction From the script to the object, but not back. Every function which is returning anything seems to fail. for example $oTVcamera.SetPosition works, but $oTVcamera.GetPosition fails. I tried call $oTVcamera.RotateX and it works how expected...
« Last Edit: July 20, 2010, 05:18:23 PM by Dr.Doktor » Logged
Mithrandir
Community Member
*
Posts: 325


« Reply #1 on: July 20, 2010, 05:07:59 PM »

I don't know about AutoIt syntax but it seems that you are calling a function (GetPosition) as if it was a property.

Try

GetPosition().z

insted of

GetPosition.z()
Logged
Dr.Doktor
Community Member
*
Posts: 2


« Reply #2 on: July 20, 2010, 06:28:29 PM »

GetPosition().z
Hi Mithrandir, thanks for your answer. But unfortunately it doesn`t solve the problem. I still get the same error:
Code:
truevision_1.au3 (106) : ==> The requested action with this object has failed.:
$x = $oTVcamera.GetPosition().x
$x = $oTVcamera.GetPosition()^ ERROR
I edit my post above in which I wrote that I think the problem is in the communication from the object to the script (I can`t call functions which have a result). Maybe the problem is anythere there.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks