BES Posted August 5, 2012 Share Posted August 5, 2012 Yeah this only happens if I use 1920x1080 for the graphics mode...I tried 1680x1050 - 800x600 and none of those have this problem..the camera spins down and im not touching any of the buttons or moving the mouse ... This is pretty basic, can someone figure out why the camera is doing that? and only with 1920x1080? require("Scripts/constants/engine_const") RegisterAbstractPath("") --graphics mode Graphics(1920,1080) --framework fw = CreateFramework() --camera camera = fw.main.camera camera:SetPosition(Vec3(0,2,-10)) --create light --light1 = CreateDirectionalLight() --light1:SetRotation(Vec3(45,45,0)) --load a sound --sound1 = LoadSound("abstract::") --PlaySound(sound1) --sound source --source1 = CreateSource(sound1,1) --PlaySource(source1) --loading a scene scene = LoadModel("abstract::Space box.gmf") if scene == nil then Notify("Failed to load scene") end scene = LoadModel("abstract::scene.gmf") if scene == nil then Notify("Failed to load scene") end MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) HideMouse(1) camrotation = Vec3(0) --MAIN while KeyHit(KEY_ESCAPE)==0 do --mouse camera movement gx = Curve (MouseX() - GraphicsWidth()/2,gx,10) gy = Curve (MouseY() - GraphicsHeight()/2,gy, 10) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) camrotation.x = camrotation.x + gy /10 camrotation.y = camrotation.y - gx /10 camera:SetRotation(camrotation) --keyboard camera movement move = Curve (KeyDown(KEY_W) - KeyDown(KEY_S),move,5) strafe = Curve (KeyDown(KEY_D) - KeyDown(KEY_A),strafe,5) camera:Move(Vec3(strafe/10,0,move/10)) fw:Update() fw:Render() SetBlend(1) SetBlend(0) Flip(0) end Quote Threadripper 2920X Gen2 CPU(AMD 12-core 24 thread) | 32Gigs DDR4 RAM | MSI Nvidia GeForce RTX 2070 Stock OCed | ASRock X399 Professional Gaming Motherboard | Triple M.2 500Gig SSD's in Raid0 Windows 10 Pro | Blender | Paint.Net | World Machine | Shader Map 4 | Substance Designer | Substance Painter | Inkscape | Universal Sound FX | ProBuilder | 3D World Studio | Spacescape | OpenSky | CubeMapGen | Ecrett Music | Godot Engine | Krita | Kumoworks | GDScript | Lua | Python | C# | Leadworks Engine | Unity Engine Link to comment Share on other sites More sharing options...
macklebee Posted August 5, 2012 Share Posted August 5, 2012 its a rounding error... add this at the top of the script: require("Scripts/math/math") then replace this section of your code with this: dx=Round(GraphicsWidth()/2)--added this dy=Round(GraphicsHeight()/2)--added this MoveMouse(dx,dy)--changed this HideMouse(1) camrotation = Vec3(0) --MAIN while KeyHit(KEY_ESCAPE)==0 do --mouse camera movement gx = Curve (MouseX() - dx,gx,10)--changed this gy = Curve (MouseY() - dy,gy, 10)--changed this MoveMouse(dx,dy)--changed this Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
BES Posted August 5, 2012 Author Share Posted August 5, 2012 Thanks! Quote Threadripper 2920X Gen2 CPU(AMD 12-core 24 thread) | 32Gigs DDR4 RAM | MSI Nvidia GeForce RTX 2070 Stock OCed | ASRock X399 Professional Gaming Motherboard | Triple M.2 500Gig SSD's in Raid0 Windows 10 Pro | Blender | Paint.Net | World Machine | Shader Map 4 | Substance Designer | Substance Painter | Inkscape | Universal Sound FX | ProBuilder | 3D World Studio | Spacescape | OpenSky | CubeMapGen | Ecrett Music | Godot Engine | Krita | Kumoworks | GDScript | Lua | Python | C# | Leadworks Engine | Unity Engine Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.