Jump to content

Models Disappearing - Josh?


Shard
 Share

Recommended Posts

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); 

post-26-12749092482445_thumb.jpg

post-26-12749092492811_thumb.jpg

post-26-12749092501768_thumb.jpg

post-26-12749092510241_thumb.jpg

simpleSigPNG.png

 

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

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.

simpleSigPNG.png

 

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

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.

Link to comment
Share on other sites

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.

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

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.

simpleSigPNG.png

 

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

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 .... >,<

simpleSigPNG.png

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

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!

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

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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.

simpleSigPNG.png

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

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

simpleSigPNG.png

 

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

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

Link to comment
Share on other sites

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.

simpleSigPNG.png

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

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;

simpleSigPNG.png

 

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

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...