Joh Posted May 28, 2012 Share Posted May 28, 2012 Hi all, I know that lua doesn't need to do this but i wanna do it.. so: How can i manage road or river after loaded the scene? I did my own process scene (and didn't debug it at all yet) but before doing this i wanna know if i should do something in particular. Opening the sbx file i saw there is some data, are those mesh data? Did i need to create it or loadscene do for me and i only need to process it? Thanks in advice. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
shadmar Posted May 28, 2012 Share Posted May 28, 2012 This is a c++ snip that inits lua and loads a scene containg road/river/lights etc.. correctly, but not sure if it's that you need (or I didn't understand the question) #include "engine.h" int main(int argc, char** argv) { Initialize(); RegisterAbstractPath("C:Leadwerks Engine SDK"); Graphics(1280,960); AFilter() ; TFilter() ; TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); TCamera cam=GetLayerCamera(layer); PositionEntity(cam,Vec3(0,0,0)); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); // Setup Initial Post Processing FX //SetGodRays(1); SetHDR(1); SetSSAO(1); SetBloom(1); SetAntialias(1); SetStats(2); LoadScene("abstract::riverscene.sbx"); // Setup spectator TBody spectator=CreateBodySphere(); SetBodyMass(spectator,1); SetBodyGravityMode(spectator,0); SetBodyDamping(spectator,1.0); EntityType(spectator,3); SetBodyBuoyancyMode(spectator,0); PositionEntity(spectator,Vec3(0,5,-10)); TVec3 camrotation=Vec3(0); float mx=0; float my=0; float move=0; float strafe=0; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); // MAIN LOOP while (!KeyHit(KEY_ESCAPE)) { 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(cam,camrotation); move=KeyDown(KEY_W)-KeyDown(KEY_S); strafe=KeyDown(KEY_D)-KeyDown(KEY_A); TVec3 force = Vec3(strafe*10.0,0,move*10.0); force=TFormVector(force,cam,0); AddBodyForce(spectator,force); PositionEntity(cam,EntityPosition(spectator)); // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } return Terminate(); } Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Joh Posted May 28, 2012 Author Share Posted May 28, 2012 Well no, my english isn't really good I wanna load it without using lua, just by code, as i told i already did the process scene for other things, but still don't know how implement road/river. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted May 28, 2012 Share Posted May 28, 2012 yes... opening up the .sbx file in notepad and searching for your river and road should key you into loading it the same way you did the other stuff...... if i'm not mistaken... but... why not take advantage of what's already there and let lua load the scene... you'll still be able to find each of the entities and manipulate em in c++... --Mike Quote Link to comment Share on other sites More sharing options...
Joh Posted May 28, 2012 Author Share Posted May 28, 2012 I saw it there are voice called river node or road node. In those string there is a voice called "data" (or something similar) and this is not saved as string, i am wondering how it saved. If i could have the "specifications" in how it's saved i could load it. Also i am not sure which kind of data those are, maybe are the mesh data. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted May 28, 2012 Share Posted May 28, 2012 ahhh, i understand what you're looking for now... disregard the above... --Mike Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 28, 2012 Share Posted May 28, 2012 Josh would need to tell you how this is stored as the user data associated with the nodes is binary data and you would need to know the format. 1 Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Joh Posted May 28, 2012 Author Share Posted May 28, 2012 Yeah that's was my question! Thaks to "fix" my english! But anyway i think i can use lua just to load the whole scene and forget about it! Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 28, 2012 Share Posted May 28, 2012 You're welcome. Unless you are intending to modify this data in some way when loading it then I guess that is your best solution. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Joh Posted May 29, 2012 Author Share Posted May 29, 2012 Well not necessary.. I just wanna get some data, that i have put on it using the editor but as now there is a command to seek all the entities i suppose it can be done later on. I am an "old" LE coder, when i used it there wasn't this command so it was a little bit harder, also i did many commercial games and i admit that i never used an easy engine as Leadwerks, that's why i always try to do everything by myself! Thanks again Pixel. 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.