Shard Posted May 26, 2010 Share Posted May 26, 2010 So I have a (large) problem with Leadwerks 2.31 and 2.32. We have a player model, with arms and a gun and armor. Unfortunately when I parent the camera to head and play the game, the gun doesn't show up. So I did several tests to see if the gun would show up and it seems to show up if the camera is further away, but in some screenshots it doesn't show it when looking at specific places (generally at the horizon). The same goes for the armor, which seems to disappear and appear as I look around. This issue came up with the update to Leadwerks 2.31 but at the time, I thought I was doing something wrong in code. After having gone back and tested all posibilities (with 2.3, 2.31 and 2.32) I firmly believe that its an issue with 2.32. Has anyone had this issue? How have you solved it? How do I solve it? Help? //Init Code EntityParent(bodyMesh,frameWork->GetMain().GetCamera()); RotateEntity(this->bodyMesh, Vec3(0,180,0)); TVec3 pos = EntityPosition(body); pos.X -= .125; pos.Y -= 2.125; pos.Z += .5; PositionEntity(bodyMesh,pos); //Update Code //Rotate camera camRotation.X = Clamp(camRotation.X + controller->GetViewY()/10, -90,60); camRotation.Y = camRotation.Y - controller->GetViewX()/10; RotateEntity(frameWork->GetMain().GetCamera(),camRotation); //Reset Mouse Position MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); float move = controller->Move(); float runSpeed = controller->Run(); //if(move > 0 && player->state != reload) move *= controller->Run(); //Update Player UpdateController(player->body,camRotation.Y,move*10,(controller->Strafe())*10, controller->Jump()*player->jumpHeight, 10000, 20); //Position the camera playerPos = EntityPosition(player->body); cameraPos = EntityPosition(frameWork->GetMain().GetCamera()); cameraPos = Vec3(playerPos.X,cameraPos.Y,playerPos.Z); cameraPos.Y = Curve(playerPos.Y+1.75,cameraPos.Y,2.0); PositionEntity(frameWork->GetMain().GetCamera(),cameraPos); Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
paramecij Posted May 26, 2010 Share Posted May 26, 2010 have you tried adjusting the camera near clip plane setting ? Quote Link to comment Share on other sites More sharing options...
Shard Posted May 27, 2010 Author Share Posted May 27, 2010 have you tried adjusting the camera near clip plane setting ? Yes I set it to near zero (0.0000001) with no effect). Also note, its all rigid objects that disappear, if that has any relevance. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Soamp Posted May 27, 2010 Share Posted May 27, 2010 Hi, We've the exact same problem. I realized that engine wont render objects when their pivot point (or their bounding box. I'm not sure yet) is'nt visible in current camera's view! We've a model with two hands and a gun model, with seprate but synced motions. The gun's pivot point position is as same as hand's. When we move camera close to the gun, it disapears when it's pivot point (and bounding box) leaves the view. Did you notice that? Do you think that's the problem too? I think it's a bug that might have to be fixed, then we could exclude some model from this hiding method. Quote Link to comment Share on other sites More sharing options...
cocopino Posted May 27, 2010 Share Posted May 27, 2010 1. Maybe your model is not centered in your modeling app. I've seen this behavior before when I used models that are not centered, the engine/camera sometimes thinks the model is out of view when it's not. 2. If not, you could try a workaround of creating a transparent bounding box. (not a very elegant solution though) -- Edit: Your model is probably animated by the looks of it. It could also be the engine is just taking 1 frame of this animation into account, if in this frame the arms are down for instance, they might not show because the model is not in view during that single frame. Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Shard Posted May 27, 2010 Author Share Posted May 27, 2010 Did you notice that? Do you think that's the problem too? This is a good possibility, but how did you fix it? 1. Maybe your model is not centered in your modeling app. I've seen this behavior before when I used models that are not centered, the engine/camera sometimes thinks the model is out of view when it's not. 2. If not, you could try a workaround of creating a transparent bounding box. (not a very elegant solution though) -- Edit: Your model is probably animated by the looks of it. It could also be the engine is just taking 1 frame of this animation into account, if in this frame the arms are down for instance, they might not show because the model is not in view during that single frame. 1. Possibility, I'll look into it. 2. How? 3. No, everything is visible in all the frames. It only disappears when its up too close. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Porsche Posted May 27, 2010 Share Posted May 27, 2010 Also, the gun still isn't visible when we zoom out (thus the bounding box should be in view), but will often times dissapear when the camera looks at the center of the horizon... "Often times"... not all the time. Frustrating .... >,< Quote Artist, Animator, Musician, P/T Programmer Dual Core @ 2.6GHz per /nVidia 9600 GT/ 4 GBs DDR3 6800 / XP Pro 32/64 Bit Photoshop CS3 / 3D Studio Max 8 / VS '08 Link to comment Share on other sites More sharing options...
cocopino Posted May 27, 2010 Share Posted May 27, 2010 2. How? In UUnwrap 3D: open your model menu Create->box, make it large enough to be always visible, uncheck replace scene. Create a transparent DDS file (transparent.DDS) Select the box on the right (Groups, box, select) Right click on materials, Add Select transparent.DDS as the diffuse map of the box. Now create the transparent.mat (you probably need some combination of mesh_skin/alphatest) Good luck! Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
Josh Posted May 27, 2010 Share Posted May 27, 2010 Unless you post a program that demonstrates the problem, we're all just speculating about what the problem might be. 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...
Canardia Posted May 27, 2010 Share Posted May 27, 2010 but will often times dissapear when the camera looks at the center of the horizon...What I have learned is that the symptom of randomly disappearing objects when camera angle is changed, is often based on the viewdistance of the scene pivot or some other entity to which your model is parented to. Try setting the viewdistance to infinite for the weapon and also for the entity to which it is parented. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Porsche Posted May 27, 2010 Share Posted May 27, 2010 What I have learned is that the symptom of randomly disappearing objects when camera angle is changed, is often based on the viewdistance of the scene pivot or some other entity to which your model is parented to. Try setting the viewdistance to infinite for the weapon and also for the entity to which it is parented. As far as the model goes, the weapon is part of the player.gmf model file. It's attached via link in 3DsMax. Should we be splitting up the gun and the arms? Unless you post a program that demonstrates the problem, we're all just speculating about what the problem might be. We'll work on this. Quote Artist, Animator, Musician, P/T Programmer Dual Core @ 2.6GHz per /nVidia 9600 GT/ 4 GBs DDR3 6800 / XP Pro 32/64 Bit Photoshop CS3 / 3D Studio Max 8 / VS '08 Link to comment Share on other sites More sharing options...
Shard Posted May 27, 2010 Author Share Posted May 27, 2010 Unless you post a program that demonstrates the problem, we're all just speculating about what the problem might be. We'll work on this. Done. Please note that I didn't include the solution files because I'm using VS2010 and I was unsure if you were using 2010. I have however included the the Main.cpp Also, please note that the movement and camera controls are inverted. This is due to a bug in our art and no related to the disappearing model problem. (Upload to LE failed twice): http://www.3rdinitiative.com/system/content/LE_Bug.zip Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Porsche Posted May 28, 2010 Share Posted May 28, 2010 Has anyone tried the download? The link was some what un-noticeable. http://www.3rdinitiative.com/system/content/LE_Bug.zip Quote Artist, Animator, Musician, P/T Programmer Dual Core @ 2.6GHz per /nVidia 9600 GT/ 4 GBs DDR3 6800 / XP Pro 32/64 Bit Photoshop CS3 / 3D Studio Max 8 / VS '08 Link to comment Share on other sites More sharing options...
Silvernite Posted May 31, 2010 Share Posted May 31, 2010 I downloaded it, I'm sure that you guys have realized that the gun only disappears when the camera is looking parallel to the floor +- 45. So maybe the bug might have something to do with a sin/cos function being called when the camera moves? If you guys like show me the bug in class on Wednesday. P.S. annoying bug, when run your game it doesn't allow me to control my mouse . The game is like noo, my mouse. ~Silvernite Quote Link to comment Share on other sites More sharing options...
Joh Posted May 31, 2010 Share Posted May 31, 2010 I have the same problem with a big ship. When i am (for example) more tthen 3/4 of it (so 1/4 is still visible) it's disappear. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Porsche Posted May 31, 2010 Share Posted May 31, 2010 Yeah the controls are all inverted. That was an old bug and has been fixed for awhile. It's not related to the gun showing up, and you can still accurately see the problem. Quote Artist, Animator, Musician, P/T Programmer Dual Core @ 2.6GHz per /nVidia 9600 GT/ 4 GBs DDR3 6800 / XP Pro 32/64 Bit Photoshop CS3 / 3D Studio Max 8 / VS '08 Link to comment Share on other sites More sharing options...
Joh Posted May 31, 2010 Share Posted May 31, 2010 I think my problem is related to this : http://leadwerks.com/werkspace/index.php?/topic/2068-object-disappearing/ Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Shard Posted May 31, 2010 Author Share Posted May 31, 2010 P.S. annoying bug, when run your game it doesn't allow me to control my mouse . The game is like noo, my mouse. ~Silvernite The mouse position is reset to the center of the screen every frame so that the mouse controls can pull the correct update for mouse movement data. You'll learn once you get your toes wet with the engine code; Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Soamp Posted May 31, 2010 Share Posted May 31, 2010 Hi, I kinda solve my problem but I dont think you can use my way. Let me walk you through it. We had a "two arms" model and a "g3 weapon" model and some motions for them, like Walk , Run , Idle , ... I load a non-animated model and use LoadAnimation command to load motions for both models. so model and motions were in seprated files, so bounding box and weapon's pivot point was down, out of view, while the animation was playing. we simply move our model (non-animated) a little up in 3DSMAX and export it. so it's bounding box (and pivot point) is now always in camera view. However I'm not sure what the problem was! I hope it helps. Quote Link to comment Share on other sites More sharing options...
Flexman Posted May 31, 2010 Share Posted May 31, 2010 So...after searching through the Wiki, how does one set entity view distance to infinity in your program? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Joh Posted May 31, 2010 Share Posted May 31, 2010 "viewdistance"="3" On material. EntityViewRange(scene,3,1); On code. Quote Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10. Link to comment Share on other sites More sharing options...
Flexman Posted May 31, 2010 Share Posted May 31, 2010 Cheers Joh Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo 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.