Just bought Leadwerks I think it is a very good product amd I can't wait to get better with it. Im going thru the Lua video tutorials on Youtube and I hit a problem.
On video 4 that discusses camera control it is using the scene.gmf file found here
http://www.leadwerks.com/werkspace/page/Documentation/le2/_/tutorials/camera-controls-r385
The scene.gmf file will not open for me in the program demo. If i use any other gmf file it opens and it opens in the model viewer as well. I have the file in my project folder so that is not it. It just keeps telling me it can't load file am I doing something wrong?
Here is the code I entered:
require("Scripts/constants/engine_const")
--Tells where to find models, etc.
RegisterAbstractPath("")
--Set Graphcs Mode
Graphics(800,600)
--Create Framework Object
fw = CreateFramework() -- Creates main world
--Set the camera
camera = fw.main.camera
camera:SetPosition(Vec3(0,2,-10))
--Create light
light = CreateDirectionalLight()
light:SetRotation(Vec3(45,45,0))
--Load a model
scene = LoadMesh("abstract::scene.gmf")
if scene == nil then --nil is not zero it is does not exist
Notify("Failed To load File!!!!")
end
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) -- x,y on screen
HideMouse(1) -- 1 is true
camrotation = Vec3(0)
--Main Loop
while KeyHit(KEY_ESCAPE) == 0 do --As long as false
gx = Curve (MouseX() - GraphicsWidth()/2,gx,10)
gy = Curve (MouseY() - GraphicsHeight()/2,gy,10)
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) -- x,y on screen
camrotation.x = camrotation.x + gy /10
camrotation.y = camrotation.y - gx /10
camera:SetRotation(camrotation)
fw:Update()
fw:Render()
Flip(0)
end
Any help would be appreciated.