About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Object disappears on screen on certain angles
Author Message
renkis Offline
Member

Post: #1
Object disappears on screen on certain angles
I have something that I find weird, and I don't understand it. I create new kinematic object in the world using Game::World.objCreate() and after it appears, the object is visible only on certain angles. When I rotate the cam around, the object disappears in the screen. It's just a solid ball for testing, so it is not related to the model (not bad normals or culling). What am I doing wrong? Could it be related to the matrix() or something?
01-09-2012 01:46 PM
Find all posts by this user Quote this message in a reply
scotty1121 Offline
Member

Post: #2
RE: Object disappears on screen on certain angles
make sure it is embedded into the terrain.
01-09-2012 04:34 PM
Find all posts by this user Quote this message in a reply
renkis Offline
Member

Post: #3
RE: Object disappears on screen on certain angles
no the access type has to be dynamic because it is kinematic. even the tutorial uses dynamic access mode.
01-09-2012 10:45 PM
Find all posts by this user Quote this message in a reply
renkis Offline
Member

Post: #4
RE: Object disappears on screen on certain angles
I try all access type except Grass and it still does the same. If my cam faces certain directions, the object is present, but if I rotate more, the object will just simply disappear. Sometimes, the shadow stays, but if I keep moving cam around the position of the object, even the shadow itself disappear. Has anyone else experience this or have ideas what is causing this?
01-10-2012 03:01 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #5
RE: Object disappears on screen on certain angles
(01-10-2012 03:01 AM)renkis Wrote:  I try all access type except Grass and it still does the same. If my cam faces certain directions, the object is present, but if I rotate more, the object will just simply disappear. Sometimes, the shadow stays, but if I keep moving cam around the position of the object, even the shadow itself disappear. Has anyone else experience this or have ideas what is causing this?

I think we both also having the same problem with this. I have some plants in the terrain and from certain angle it appear but if I move the camera to another angel, some part of the plants disappear but when I move back, its reappear again.
01-10-2012 03:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
renkis Offline
Member

Post: #6
RE: Object disappears on screen on certain angles
(01-10-2012 03:44 AM)dylantan Wrote:  I think we both also having the same problem with this. I have some plants in the terrain and from certain angle it appear but if I move the camera to another angel, some part of the plants disappear but when I move back, its reappear again.

are you sure it is not your normals or culling in your model? For me, a simple Ball mesh completely disappears when I pan the cam around and get to a range of angles, then it will appear again once I am back on range of good angles. It is the whole mesh, not just a part of it.
01-10-2012 01:46 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #7
RE: Object disappears on screen on certain angles
make sure your materials have "Cull" unchecked.

Man, it's always that semicolon...
01-10-2012 03:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
neo22 Offline
Member

Post: #8
RE: Object disappears on screen on certain angles
I have kind of the same problem shape when a world is loaded.
And i noticed an other problem that you can see on this video :

http://youtu.be/rIc2NT075cU?hd=1

it's kind of a "ghosting" issue, maybe because of the sun ray effect.

your problem is maybe related to this.

to Esenthel : What can i do to solve this "Ghosting" problem?
01-10-2012 07:31 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #9
RE: Object disappears on screen on certain angles
Ok, So that model is probably huge. I have some solutions since I've been over this.
First of all, Look so the model is good size, not huge since some models can be like that. Then if it's huge it may disappear, And also. For world thing in different angles. My friend had that when i did import the models and sat the physics, but when he readded them by simply pressing insert it was fine. Also look so your model is centered. So it's not like far away from the X,Y,Z angle points. That could mean it's basically too far away, so the editor makes it go away.

Man, it's always that semicolon...
01-10-2012 10:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
renkis Offline
Member

Post: #10
RE: Object disappears on screen on certain angles
still no luck. Had cull on and off, re-centered mesh, etc.

All I do is the following:
Code:
...
Game::ObjParamsPtr obj=Game::Objs.ptrRequire(objpath); if(!obj) return false;
return Game::World.objCreate(*obj, Matrix(obj->scale(), srcvec));

srcvec is vector where object is placed in game world.

obj is a custom objtype. In its ::create(Game::ObjParams &op) function:
Code:
...
   curpos  =op.matrixFinal().pos;
   mesh    =op.mesh       ();
   material=op.material   ();
   phys    =op.phys       ();
   scale   =op.scale      ();
  _matrix  =op.matrixFinal();
  _matrix.normalize(); _matrix_scaled=_matrix; _matrix_scaled.scaleOrn(scale);

   if(phys) actor.create   (*phys, 1, scale, true)
                 .matrix   (_matrix              )
                 .obj      (this                 )
                 .group    (AG_PROJECTILE        )
                 .kinematic(true                 );

Object appears after ::World.objCreate() call, but if you walk around the object, depending on angle, it will disappear completely then appear again after a certain range of angles.

I've also attached the obj settings.


Attached File(s) Image(s)
   
01-11-2012 02:17 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #11
RE: Object disappears on screen on certain angles
(01-10-2012 07:31 PM)neo22 Wrote:  What can i do to solve this "Ghosting" problem?

Are you rebuilding the depth before performing any debug drawing?

Code:
void Draw()
{
   Renderer(Render);
   if (Renderer.rebuildDepthNeededForDebugDrawing()) Renderer.rebuildDepth();

   // debug drawing...
}
01-11-2012 06:34 AM
Find all posts by this user Quote this message in a reply
neo22 Offline
Member

Post: #12
RE: Object disappears on screen on certain angles
Driklyn Wrote:Are you rebuilding the depth before performing any debug drawing?

Problem solved, thanks Driklyn, you rocks!
01-11-2012 08:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply