Jump to content

Search the Community

Showing results for tags 'c++'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • SALVATIONLAND
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Ultimate Action Game Controller

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Streams and Events
  • Tutorials
  • Games
  • Work in Progress

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

  1. I get "Lua Error: error loading module 'plugin/libLua-test' from file './plugin/libLua-test.so':|dynamic libraries not enabled; check your Lua installation" When I try to load my own library. This thread http://www.leadwerks.com/werkspace/topic/10566-require/page__hl__require suggests that turning off sandbox will do the trick - I've tried it both in the LE editor and in c++ neither makes any difference. Since he made it work I'm thinking this could be the linux version having different lua permissions? Or is removing the sandbox check mark and doing Interpreter::sandboxmode=false; in App::Start() before loading the map not enough to turn off sandbox?
  2. Disclaimer: It's getting a bit late so maybe I'm missing something obvious I've been trying to figure out the Interpreter class and how to create custom lua functions, and it's going well quite apart from not being able to identify a register function on the interpreter class - so I cheated a bit there. static int addTwo(lua_State *L){ int argc=Interpreter::GetStackSize(); // equiv to lua_gettop(Interpreter::L) ? int i,t; for (i = 1; i <= argc; i++){ t=Interpreter::ToNumber(i); std::cout << "[C++]addTwo(" << t << ")=" << (t+2) << std::endl; Interpreter::PushFloat(t+2); } return i-1; } and in App::Start() lua_register(Interpreter::L,"addTwo",addTwo); In the fps player controller i added this a,b,c=addTwo(1,2,3) System:Print(a) System:Print(B) System:Print(c) to the pickup code rigth after "mass = pickInfo.entity:GetMass()" to make sure I can trigger it when ever I want. Now the strange bit is this works perfectly in Code::blocks - but by when I run it in the LE editor it instantly crashed when I try to pick something up. I've tried toggling sandbox to no avail
  3. Hello, the active context is not resizing correctly when changing the window layout without rendering a world. Resizing while rendering a world: Resizing without rendering a world: Example code: bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; if (window->KeyHit(Key::J)) { window->SetLayout(window->GetX(), window->GetY(), 1920, 1080); } if (window->KeyHit(Key::K)) { window->SetLayout(window->GetX(), window->GetY(), 1024, 800); } //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { if (!freelookmode) return false; freelookmode=false; window->ShowMouse(); } //if (freelookmode) //{ // //Keyboard movement // float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05; // float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05; // camera->Move(strafe,0,move); // //Get the mouse movement // float sx = context->GetWidth()/2; // float sy = context->GetHeight()/2; // Vec3 mouseposition = window->GetMousePosition(); // float dx = mouseposition.x - sx; // float dy = mouseposition.y - sy; // //Adjust and set the camera rotation // camerarotation.x += dy / 10.0; // camerarotation.y += dx / 10.0; // camera->SetRotation(camerarotation); // //Move the mouse to the center of the screen // window->SetMousePosition(sx,sy); //} Leadwerks::Time::Update(); //world->Update(); //world->Render(); context->SetColor(0, 0, 0, 1); context->Clear(); context->SetColor(1, 1, 1, 1); context->SetBlendMode(Blend::Alpha); context->DrawText("10x10", 10, 10); context->DrawText("100x100", 100, 100); context->SetBlendMode(Blend::Solid); context->Sync(false); return true; } Comment / Uncomment the world update and rendering and press J and K a few times to resize.
  4. Hello everyone, I am experiencing some issues with the Window::Show/HideMouse methods. When calling both of them multiple times they basically stop working. For example: bool App::Start() { //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create("cc"); window->ShowMouse(); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); //Hide the mouse cursor window->HideMouse(); std::string mapname = System::GetProperty("map","Maps/start.map"); Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); window->ShowMouse(); window->HideMouse(); return true; } In the above example the mouse pointer will be visible, but it should be hidden.
  5. Vulcan

    VideoPlayer

    I want to share with the community a video player that I have been tinkering with lately. Hopefully this will be useful for someone. I wish I could have got the audio streaming to work because the ogg-file has both video and audio data. But instead I made it load a wav-file. Issues I know about: Memory leak (please help with this issue) No sound streaming (must have separate wav-file) Not yet tested if transparency works Note: Click on the upper-middle button to download zip-file. https://drive.google.com/file/d/0B1zs1aY8SN3nSm9ObjFaSmtCX28/edit?usp=sharing Does anyone know if this could use lua bindings to make it work with lua too?
  6. How do I stop the sound? I can not find any Stop(). Sound* sound; sound = Sound::Load(wav_file); sound->Play();
  7. I am looking for detailed information on Leadwerks::Sound. There are a couple of variables I am not sure about. float length; Is length in seconds (ie: 1.0f = 1 sec) or is it number of samples? Also I wonder about format. int format; Is one of those "static const int" below? Lastly I would like to know if I could/should use BankStream to update Bank* data if I get audio stream from a video decoder?
  8. Hi, I'm doing a planet generator for my game. But I've some problems with the c++ libnoise. I successfully generated a quadtree (maybe with a bad algo... ^^') and successfully transformed it into a sphere according to this great blog. But now, I want to apply a perlin noise using the c++ libnoise library. But the render is not really good... But I think I'm in the right way. My problem is about the noise coherence between each faces of my cube. The faces are not joined. Here is a screenshot. I do this following code to generate one face of my cube : //generating the front face... Surface* frontFace = model->AddSurface(); for(int i = 0 ; i<numSquare ; i++) { for(int j = 0 ; j<numSquare ; j++) { float x = -1+i*segment; float y = -1+j*segment; float z = -1; float dx = (x * sqrtf(1.0 - (y*y/2.0) - (z*z/2.0) + (y*y*z*z/3.0))) * Radius; //transform into sphere float dy = (y * sqrtf(1.0 - (z*z/2.0) - (x*x/2.0) + (z*z*x*x/3.0))) * Radius; float dz = (z * sqrtf(1.0 - (x*x/2.0) - (y*y/2.0) + (x*x*y*y/3.0))) * Radius; float ndz = dz + perlinModule.GetValue(dx,dy,dz);//generate noise int v0 = frontFace->AddVertex(dx,dy,ndz); x = -1+(i*segment)+segment; y = -1+j*segment; z = -1; dx = (x * sqrtf(1.0 - (y*y/2.0) - (z*z/2.0) + (y*y*z*z/3.0))) * Radius; dy = (y * sqrtf(1.0 - (z*z/2.0) - (x*x/2.0) + (z*z*x*x/3.0))) * Radius; dz = (z * sqrtf(1.0 - (x*x/2.0) - (y*y/2.0) + (x*x*y*y/3.0))) * Radius; ndz = dz + perlinModule.GetValue(dx,dy,dz); int v1 = frontFace->AddVertex(dx,dy,ndz); x = -1+(i*segment)+segment; y = -1+(j*segment)+segment; z = -1; dx = (x * sqrtf(1.0 - (y*y/2.0) - (z*z/2.0) + (y*y*z*z/3.0))) * Radius; dy = (y * sqrtf(1.0 - (z*z/2.0) - (x*x/2.0) + (z*z*x*x/3.0))) * Radius; dz = (z * sqrtf(1.0 - (x*x/2.0) - (y*y/2.0) + (x*x*y*y/3.0))) * Radius; ndz = dz + perlinModule.GetValue(dx,dy,dz); int v2 = frontFace->AddVertex(dx,dy,ndz); x = -1+i*segment; y = -1+(j*segment)+segment; z = -1; dx = (x * sqrtf(1.0 - (y*y/2.0) - (z*z/2.0) + (y*y*z*z/3.0))) * Radius; dy = (y * sqrtf(1.0 - (z*z/2.0) - (x*x/2.0) + (z*z*x*x/3.0))) * Radius; dz = (z * sqrtf(1.0 - (x*x/2.0) - (y*y/2.0) + (x*x*y*y/3.0))) * Radius; ndz = dz + perlinModule.GetValue(dx,dy,dz); int v3 = frontFace->AddVertex(dx,dy,ndz); frontFace->AddTriangle(v2,v1,v0); frontFace->AddTriangle(v0,v3,v2); } } I don't know how to solve this. I didn't find good explanations on the web. I'm not really good in maths but I've some logic ideas (I think ...), it's a miracle if this code works xD. Maybe it's my cube generation algorythm which is bad... I understood that some others use a lerp function to join "smoothly" each faces, but I don't know how I can apply this to my code. ^^' If someone can help it would be great. Thx ! PS: I'm french so really sorry for my english
  9. I think Leadwerks should have a video player for the purpose to show intro video and game scenes. Yesterday I did make short intro video (6 sec, compressed AVI, ~2 MB) in Blender that was good but did not have an easy way to play this intro when game start. I suggest having a Cinema class that play a video in window/fullscreen with Play/Stop. Cinema* intro = new Cinema("Video/intro.avi"); if(intro->isLoaded()) intro->Play(); intro->Unload(); delete intro; As a temporary solution I made a cinema class and all works pretty well, except for that it takes about ~500 MB. And it uses *.tex files as each frame (0001.tex -> 0099.tex in my case). Cinema.txt
  10. I ran into a problem with loading map as I use a state machine to switch in and out between main menu and game level. First I didn't notice that the map wasn't unloaded as I thought it was unloaded when that state exited. But when I try to go back second time from menu it crashes and debugger points at Map::Load(..). But how do I unload the map (when unloading state) so it could load another map later? I have tryied with world->Clear() and world->Release() but without luck. How can I overcome this problem?
  11. With Lua I could use Script:Collision( entity, position, normal, speed) and place out a box-trigger. Found a video illustrating this in Lua: But how could I do that in C++? I have looked in Entity.h for clues and I suspect it might be OnCollision(...) but not sure howto. Maybe this should be mentioned in the documentation with an example.
  12. Hi! I recently encountered a problem when I tryied to get an entity based on its name. First I made a box in LE as "Box 1" in the scene list/graph. And I was trying to find the entity "Box 1" in C++ but for some reason it does not show up. I am not sure how to interact with this box otherwise. list<Entity*>::iterator iter; for (iter = world->entities.begin(); iter != world->entities.end();++iter) { fileLogger.Log("Entity: " + (*iter)->GetKeyValue("name")); } When looking through the log I don't find "Box 1" anywhere. ... [21:13:39] Entity: [21:13:39] Entity: [21:13:39] Entity: [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: cardboardbox [21:13:39] Entity: Directional Light 2 [21:13:40] Entity: [21:13:40] Entity: BarbarianLDigit110 [21:13:40] Entity: BarbarianLFoot [21:13:40] Entity: barbarian_knee_pad_L [21:13:40] Entity: BarbarianLCalf ... In LE scene graph there is "Directional Light 2", several "cardboardbox" and last "Box 1". Rest is loaded from C++. I don't know what to do, please help!
  13. Hi guys, without a steam_appid.txt my application runs slower than with, especially map loading. I am curious, is anyone experiencing the same? Cheers, Bryan
  14. Hey, Is it possible to export to Linux from Windows? I know that Mac OSX isn't even supported yet. And I think we would need to use something like MinGW right? I think the msvc compiler is only able to compile for Windows. And if we can't compile from Windows for Linux, is it possible to compile for Windows and Linux on Linux?
  15. What exactly is Time::GetSpeed() returning? In the reference I find this: Is it seconds, ticks or what?
  16. Hey, Is there any possibility to check if you are in a shadow? I need this for a stealth like game (like the thief series). And maybe how much of a object is in the shadows? Thanks
  17. What I am trying to work is out code that allows the player to use objects, in this case by pressing the E key when their mouse is over a usable object. Now this is done, the problem is the range. Using a pick, the camera will pick something regardless of its range to the player. So even if the button I use is fifteen miles away, it'll still activate it as long as the mouse is technically over it. My question is, Leadwerks 2.5 allowed us to give the pick a distance (anything past that distance was ignored basically), how do I do this in 3.2? tp_toPick.distance doesn't work. It always returns -1 regardless of distance. Basic code is here, with the action code cut out. if (window->KeyHit(Key::E)) { if (camera->Pick(centerMouse.x, centerMouse.y, tp_toPick, 0, true) == 1) { //If things are a certain distance, perform the relevant action on the pick. } }
  18. Hi, is it possible to use the depthbuffer for postprocessing effects? I looked at all the existing postprocessing shaders and saw, all of them only use the color-texture, which is retrieved by uniform sampler2D texture1; I also found, that texture2 contains some kind of a cobblestone texture but all the other slots seem to be empty. Also I saw, it is possible to push a Vec4 Uniform to the shader by (C++): myShader->SetVec4("foo", Vec4(0,0, 1, 1)); (GLSL): uniform vec4 foo; but I didn't find any way of pushing an arbitrary texture as a uniform.
  19. My friends are telling me that I am playing "Spacewar" all the time, and it is quite annoying for them. It did take some time before I realised that it was my Leadwerks C++ project I was developing on that was the cause of it. I wish there was a way to disable Steam notifications, because I am constanly iterating compile-run-compile. I would suggest something like #define __STEAM_DISABLE__ at the top of App.h Also would like to know how I could disable the console as end-users could get distracted. At least when publishing a game.
  20. Hello, example code to raise this exception: #include "App.h" using namespace Leadwerks; Entity* entity = NULL; void UpdateWorldHook(Leadwerks::Entity* entity); void PostRenderHook(Leadwerks::Entity* entity); void UpdatePhysicsHook(Leadwerks::Entity* entity); void CollisionHook(Leadwerks::Entity* entity0, Leadwerks::Entity* entity1, float* position, float* normal, float speed); App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) { } App::~App() { // Clear any set user data entity->SetUserData(NULL); // Remove hooks entity->RemoveHook(Entity::UpdateWorldHook, &UpdateWorldHook); entity->RemoveHook(Entity::UpdatePhysicsHook, &UpdatePhysicsHook); entity->RemoveHook(Entity::PostRenderHook, &PostRenderHook); entity->RemoveHook(Entity::CollisionHook, &CollisionHook); entity->Release(); entity = NULL; delete world; delete window; } Vec3 camerarotation; #if defined (PLATFORM_WINDOWS) || defined (PLATFORM_MACOS) bool freelookmode=true; #else bool freelookmode=false; #endif bool App::Start() { //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create("tst"); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); //Hide the mouse cursor window->HideMouse(); std::string mapname = System::GetProperty("map","Maps/start.map"); Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); entity = Pivot::Create(); entity->SetUserData(this); // Register hooks entity->AddHook(Entity::UpdateWorldHook, &UpdateWorldHook); entity->AddHook(Entity::UpdatePhysicsHook, &UpdatePhysicsHook); entity->AddHook(Entity::PostRenderHook, &PostRenderHook); entity->AddHook(Entity::CollisionHook, &CollisionHook); return true; } bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { if (!freelookmode) return false; freelookmode=false; window->ShowMouse(); } if (freelookmode) { //Keyboard movement float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05; float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05; camera->Move(strafe,0,move); //Get the mouse movement float sx = context->GetWidth()/2; float sy = context->GetHeight()/2; Vec3 mouseposition = window->GetMousePosition(); float dx = mouseposition.x - sx; float dy = mouseposition.y - sy; //Adjust and set the camera rotation camerarotation.x += dy / 10.0; camerarotation.y += dx / 10.0; camera->SetRotation(camerarotation); //Move the mouse to the center of the screen window->SetMousePosition(sx,sy); } Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(false); return true; } void UpdateWorldHook(Leadwerks::Entity* entity) { } void PostRenderHook(Leadwerks::Entity* entity) { } void UpdatePhysicsHook(Leadwerks::Entity* entity) { } void CollisionHook(Leadwerks::Entity* entity0, Leadwerks::Entity* entity1, float* position, float* normal, float speed) { } Comment out the Object::RemoveHook calls to prevent this from happening.
  21. Hi, LeadwerksDemo has some errors on Ubuntu 14.04 : - At compiling, Leadwerks.h can't be found : - BackSlash are used instead Slash : - Some files and local vars are missing :
  22. I used the GLSL export plugin from Blender in order to use with the game engine as a material, but I can't seem to use it properly. I tried following the information provided by the Leadwerks wiki, but I'm not a programmer, so I don't know how to properly call the .vert and .frag files into Leadwerks. Any indication of what to do would be greatly appreciated! http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Game_Engine/Export_GLSL
  23. I found a free model I can play with of nice quality. I have the following situation: Like you can see the models initial rotation is wrong, it should be facing the direction of brush. This code can fix the rotation for me: ship->SetRotation(90,90,0, true); But then I have issue with ship movement: if(window->KeyDown(Key::A)) { ship->Move(-move_speed,0,0); } if(window->KeyDown(Key:)) { ship->Move(move_speed,0,0); } if(window->KeyDown(Key::S)) { ship->Move(0,0,-move_speed); } if(window->KeyDown(Key::W)) { ship->Move(0,0,move_speed); } Movement would be in the wrong then directions. I could also adjust this but obviously it's not the right way. I am aware you can rotate it in some 3D software like blender, but I'm trying to avoid it right now. and generally what would be best practice for such cases?
  24. I am working my way through some of the sample code and making slight modifications. I am stuck with a very simple problem. I cannot manage to get a model to successfully render a texture. I am using slightly modified code from the leadwerks docs and a stock material. Any insight to my challenged code/thought process is appreciated. #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } bool App::Start() { window = Window::Create(); context = Context::Create(window); world = World::Create(); camera = Camera::Create(); camera->SetRotation(5, 0, 0); camera->Move(0, 0, -6); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); Model* model = NULL; model = Model::Create(); model->SetColor(1.0, 0.0, 1.0); model->SetPosition(0, 0, 0); material = Material::Load("Materials/Concrete/concrete_dirty.mat"); Surface* surface = model->AddSurface(); surface->AddVertex(-0.5, -0.5, 0, 0, 0, -1); surface->AddVertex(0.5, -0.5, 0, 0, 0, -1); surface->AddVertex(0.5, 0.5, 0, 0, 0, -1); surface->AddVertex(-0.5, 0.5, 0, 0, 0, -1); surface->AddTriangle(2, 1, 0); surface->AddTriangle(0, 3, 2); surface->UpdateAABB(); model->SetMaterial(material,1); model->UpdateAABB(Entity::LocalAABB | Entity::GlobalAABB); return true; } bool App::Loop() { if (window->Closed() || window->KeyDown(Key::Escape)) return false; Time::Update(); world->Update(); world->Render(); context->Sync(); return true; }
  25. Although my project compiles after I added 'pthread' and 'X11' to linker in build options, the Code::Blocks IDE is unable to find the declarations of the 'Leadwerks' namespace. For example: window = Leadwerks::Window::Create("MyGame", 200, 150, 1024, 768, Leadwerks::Window::Titlebar); When pressing LMB on 'Create' and choosing "Go to deceleration ..." the action results an error. My version of Code::Blocks is 13.12, the default install on Ubuntu 14.04. I did not find any 'special' way to add the files to IDE, their path is clearly in the include. Should I add what's inside /home/myuser/Leadwerks/Include/ to the project files or anything like that?
×
×
  • Create New...