Jump to content
shadmar

Camera movement crashes engine.exe

Recommended Posts

Hi

 

I manage to crash engine.exe when moving camera. This is what I do (just copy paste into the lua editor)

Is this a local problem for me or ?

 

Running Windows7 x64 - GF8600M GT 256mb, latest LE from updater.

 

 

Use WASD and FV and mouse for control:

 

require("scripts/constants/engine_const")

--Register the abstract path 
RegisterAbstractPath("") 
--Set a graphics mode 
Graphics(800,600) 

-- Create a framework object 
fw = CreateFramework() 
--set the camera 
camera = fw.main.camera 
camera:SetPosition(Vec3(0,2,-10)) 
--Create a cube
cube=CreateCube() 
cube:Turn(Vec3(0.1,0.1,0.1)) 
cube: SetPosition(Vec3(0,1,0)) 
cube: SetScale(Vec3(2,2,2)) 
--Create a mesh from scratch
mesh3=CreateMesh()
surf=CreateSurface(mesh3)
surf:AddVertex(Vec3(-0.5,0,0))
surf:AddVertex(Vec3(0.5,1,0))
surf:AddVertex(Vec3(0.5,0,0))
surf:AddTriangle(0,1,2);
surf:SetVertexNormal(0,Vec3(0,0,-1));
surf:SetVertexNormal(1,Vec3(0,0,-1));
surf:SetVertexNormal(2,Vec3(0,0,-1));
surf:SetVertexTexCoords(0,Vec2(0,1));
surf:SetVertexTexCoords(1,Vec2(1,0));
surf:SetVertexTexCoords(2,Vec2(1,1));
UpdateMesh(mesh3)
PositionEntity(mesh3,Vec3(2,0,-3));

--Create a light 
light=CreatePointLight(18) 
SetShadowSoftness(light,2);
SetShadowmapSize(light,512);
light:SetPosition(Vec3(3,6,0)) 

--DebugLights(1) 
--Create ground 
--cube2=CreateCube() 
--cube2: SetPosition(Vec3(0,-2,0)) 
--cube2: SetScale(Vec3(20,1,20)) 

--terrain
terrain=CreateTerrain( 512 ) 
TerrainDetail( 10 ) 
--terrain:SetPosition(Vec3(3000,0,0)) -- this doesn't work ?
fw.renderer:SetWireFrame(1)

--Move the mouse to the center of the screen and hide it 
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) 
HideMouse(1) 
camrotation=Vec3(0)

--Create the main loop 

--while AppTerminate()==0 or KeyDown(KEY_ESCAPE)==0 do 
while KeyDown(KEY_ESCAPE)==0 do

--spin something
cube:Turn(Vec3(0,0.1,0.1)) 
mesh3:Turn(Vec3(0.1,0.1,0.1)) 

--Camera rotation 
gx=Curve(MouseX() - GraphicsWidth() /2, gx, 20) 
gx=Curve(MouseX() - GraphicsWidth() /2, gx, 20) 
gy=Curve(MouseY() - GraphicsHeight() /2, gy, 20) 
camrotation.x = camrotation.x + gy / 100
camrotation.y = camrotation.y - gx / 100
camera:SetRotation(camrotation,1)

--Camera movement 
move = Curve(KeyDown(KEY_W) - KeyDown(KEY_S), move, 10) 
updown = Curve(KeyDown(KEY_F) - KeyDown(KEY_V), updown, 10) 
strafe = Curve(KeyDown(KEY_D) - KeyDown(KEY_A), strafe, 10) 
camera:Move(Vec3(move/10, updown/10, strafe/10))

fw:Update() 
fw:Render() 
Flip(0) 
end 

Share this post


Link to post

works fine here =)

the camera just turns too fast and the controls are switched (a and s, w and d)

 

Yes it does here too, after closing the other 3d apps, wierd.

Local issue on my part I guess.

 

Thanks for the testing :)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...