Chiblue Posted February 27, 2010 Share Posted February 27, 2010 I am using gamelib to create my FPS controller, I have been playing around with different types of weapons, and using rifles or longer barrel weapons everything runs fine, but today I built a pistol into the game and are experiencing some strange events... when I move the weapon up and down when it gets towards level the mesh disappears, I believe this is something to do with it passing through the controller mesh.... when I use a rifle this is long enough and is always passing through the controller mesh... could this be the problem or is something else happening.. there is no animation played at this point that is different than the up or down position? Any suggestions would be appreciated... Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Canardia Posted February 27, 2010 Share Posted February 27, 2010 Try setting your camera near range smaller, for example CameraRange(cam,0.01f,50000). 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...
Josh Posted February 27, 2010 Share Posted February 27, 2010 The mesh bounding box might not match the range of the animation, if it is an animated mesh. 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...
Chiblue Posted February 27, 2010 Author Share Posted February 27, 2010 The mesh bounding box might not match the range of the animation, if it is an animated mesh. I am confused... I do not have a bounding box, I have not set any collisions on the animated object.. or is there a different bounding box I should be considering? Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
macklebee Posted February 27, 2010 Share Posted February 27, 2010 Turn on the 'Show Boxes' in the Options' Display tab of the Editor. That will show your bounding box. 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...
Chiblue Posted February 27, 2010 Author Share Posted February 27, 2010 It cannot be the CameraRange as it will disappear as the camera rotates, even so I did change this to near = 0.01f and still have the problem... Although if I change the camerazoom to say 1 it works, if I chage it to 1.1 it disappears when level... if I set the model z to say 0.1f it works so long as the zoom is low, i.e. <1.5... so this is obviously something going on with the camera render, not sure what it does not look like culling as the entire model disappears.. Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Chiblue Posted February 27, 2010 Author Share Posted February 27, 2010 Turn on the 'Show Boxes' in the Options' Display tab of the Editor. That will show your bounding box. Bounding box contains the model at all points in hte animation as far as I can tell in the editor.. Also given that the animation is static at a specific frame and is not changing if the bounding box was the issue would this not cause the weapon to disapear all the time? Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Chiblue Posted February 27, 2010 Author Share Posted February 27, 2010 This is definitely a camera issue I added a second camera to follow and view the controller and the mesh shows perfectly with all animation. I changed the camera near setting which had no perceivable affect the only things that affect it are the zoom and moving the model forward on the z. I checked all camera setting and see nothing unless there as something inside le that is impacting this? Quote If it's not Tactical realism then you are just playing.. Link to comment Share on other sites More sharing options...
Josh Posted February 28, 2010 Share Posted February 28, 2010 No one can help you unless you post some code demonstrating your problem. 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...
Chiblue Posted March 1, 2010 Author Share Posted March 1, 2010 No one can help you unless you post some code demonstrating your problem. Given the size of the project... I cannot provide it all, but these are the specific parts... Declaring the mesh..weapon class setup.. modelhud = LoadMesh(hudmesh); This code is called when a weapon is selected by the player.. TWeapon *weap = &weaponslot[currentweapon].weapon; EntityShadowMode(weap->modelhud,false); ScaleEntity(weap->modelhud,Vec3(weap->GameScale,weap->GameScale,weap->GameScale)); EntityParent(weap->modelhud, cam); PositionEntity(weap->modelhud,EntityPosition(cam,1),0); TVec3 rot = EntityRotation(cam,0); RotateEntity(weap->modelhud,Vec3(rot.X+weap->rotatex,rot.Y+weap->rotatey,rot.Z+weap->rotatez),0); TranslateEntity(weap->modelhud,Vec3((flt)weap->horiz,(flt)weap->vert,(flt)weap->forward),0); ShowEntity(weap->modelhud); EntityOcclusionMode(weap->modelhud,0); EntityType(weap->modelhud,11); CameraZoom(cam,weap->stdzoom); weaponstatus = ready; firingstep = 0; animwait = false; SetFPSAnimation("draw"); This is the code that rotates the camera... TPlayer *pla = scene.currentplayer; TWeapon *weap = pla->GetWeapon(); mx=Curve((flt)MouseX()-scene.cx,mx,4); my=Curve((flt)MouseY()-scene.cy,my,4); CenterMouse(); camrot=EntityRotation(cam); camrot.X+=my*scene.GetCurrentPlayer()->turnspeedY/camzoomcurrent; camrot.X=Clamp(camrot.X,mincamXangle,maxcamXangle); camrot.Y-=mx*scene.GetCurrentPlayer()->turnspeedX/camzoomcurrent; camrot.Z=0; RotateEntity(cam,camrot); RotateEntity(scene.GetCurrentPlayer()->campivot,camrot,1); This code was mainly adapted from the Gamelib.. so you will see many similarities.. Please let me know if you need any further explanation? Quote If it's not Tactical realism then you are just playing.. 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.