Joh Posted June 3, 2012 Share Posted June 3, 2012 Hi all, i have a problem when i load the desert map on the editor everythings work fine, when i use the example on leadwerks wiki it load the map cprrectly but when the camera goes near to the street some face of the road flick and goes away (probably under the terrain). Do you know why? I can't show images right now because i am from the mobile. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Joh Posted June 3, 2012 Author Share Posted June 3, 2012 http://db.tt/8Zv5vYwM Here you can see the image. As i told this doesn' happened on editor and i simply copied an pasted the code on documentation (lua an bmax) Any idea? Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
shadmar Posted June 3, 2012 Share Posted June 3, 2012 You could try increasing the offset just a bit to 0.01 from the road_node.lua it should be : class.roadoffset=0.005 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Joh Posted June 3, 2012 Author Share Posted June 3, 2012 This seem don't have any effetcs, i don't see this error when the camera is far away. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Joh Posted June 4, 2012 Author Share Posted June 4, 2012 The three images show you the issue.. This happened ONLY using this code (not in the editor) that is token by the documentation.. Framework leadwerks.engine Import "c:leadwerks engine sdkbmxframeworkframework.bmx" Include "lua-gluefunctions.bmx" GCSetMode(2) RegisterAbstractPath ("c:leadwerks engine sdk") Graphics(800, 600) 'Create a framework instance called 'fw'' Global fw:TFramework = CreateFramework() If Not fw RuntimeError "Failed to initialize engine." 'Pass to the lua state' SetScriptObject("fw", fw) Global scene:TEntity = LoadScene("abstract::deserthighway.sbx") PositionEntity(fw.Main.camera, StringToVec3(GetEntityKey(scene, "cameraposition"))) 'movement variables' Global move:Float = 0.0 Global strafe:Float = 0.0 Global camrotation:TVec3 = Vec3(0) Global mx:Float = 0.0 Global my:Float = 0.0 HideMouse() fw.SetStats(1) 'Main loop' Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit 'camera rotation/movement' CameraUpdate() fw.Update() fw.Render() SetBlend(1) DrawText("Use WSAD/Mouse to move/rotate camera",0,20) SetBlend(0) Flip(0) Forever GCCollect() ShowMouse() End Function CameraUpdate() mx = Curve(MouseX() - GraphicsWidth() / 2, mx, 6) my = Curve(MouseY() - GraphicsHeight() / 2, my, 6) MoveMouse(GraphicsWidth() / 2, GraphicsHeight() / 2) camrotation.X = camrotation.X + my / 10.0 camrotation.Y = camrotation.Y - mx / 10.0 RotateEntity(fw.Main.camera, camrotation) move = KeyDown(KEY_W) - KeyDown(KEY_S) strafe = KeyDown(KEY_D) - KeyDown(KEY_A) MoveEntity(fw.Main.camera, Vec3(strafe / 10.0, 0, move / 10.0)) End Function Function StringToVec3:TVec3(text:String, scale:Float = 1.0) Local t:TVec3 = Vec3(1) Local sarr:String[] sarr = text.split(",") If sarr If sarr.length > 0 t.x = Float(sarr[0]) * scale If sarr.length > 1 t.y = Float(sarr[1]) * scale If sarr.length > 2 t.z = Float(sarr[2]) * scale EndIf Return t EndFunction 'These functions allow you to pass framework to the lua state' Function SetScriptObject(name:String, o:Object) Local size:Int=GetStackSize() lua_pushbmaxobject(luastate.L,o) lua_setglobal(luastate.L,name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int=GetStackSize() If size<currentsize lua_pop(luastate.L, currentsize - size) EndIf EndFunction Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Joh Posted June 4, 2012 Author Share Posted June 4, 2012 I just tested on my office pc and had the same result. Is there anyone who have the same issue? This evening i will try a fresh install. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Joh Posted June 4, 2012 Author Share Posted June 4, 2012 Also compiled from another pc and same weird result.. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Joh Posted June 4, 2012 Author Share Posted June 4, 2012 Josh just a question, which version of bmax you used to compile? Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Josh Posted June 4, 2012 Share Posted June 4, 2012 It's 1.45, but that's not going to make any difference. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Joh Posted June 5, 2012 Author Share Posted June 5, 2012 Found a workaround i simply raised a bit the road. Do you "fix" the y pos on editor? I really don't know what think, anyway seem ok for the moment. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Josh Posted June 5, 2012 Share Posted June 5, 2012 No, but the script has a slight offset. However, it should behave the same in your program as it does in the editor. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
macklebee Posted June 5, 2012 Share Posted June 5, 2012 It never has (as is shown from the multiple returns from searching for the term 'roadoffset'). Bmax and standalone lua scripts (and i assume c++) have always required an adjustments to the 'class.roadoffset' value. To get it to work, you have to do certain steps. 1) Open the road_node script, change the 'class.roadoffset' value to 0.055, and save the script 2) Open up the scene (SBX) in the editor, click on the 'Rebuild Roads' icon in the editor toolbar, and then save the scene (SBX) in the editor Now load that saved scene into your program and it should work as this works for me now and for the past two years - keep in mind that you might have to update files in your project folder, like the map, the road node script, etc, if they are separate from your SDK files 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...
Joh Posted June 5, 2012 Author Share Posted June 5, 2012 Thanks mack, i'll try this. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. 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.