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:
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:
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
$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:
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:
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...