ShiVa3D
Object clipping issue [video]
All about the StoneScriptObject clipping issue [video]
by Bryce » 13 May 2011, 08:34
Hi. Another issue, another chance to play around with video capture! Pardon the silliness of this scene (it looks like a carnival). I was testing object orbiters.
http://www.nebulacafe.com/dump/Clipping_issue.mp4
Anyhow, here's the issue. The asteroid platform which the Skycar is riding rotates via object.rotateAround(). The camera follows the Skycar very closely. When the asteroid (and the camera) make it about halfway through the orbit, in front of the rotation center point, the asteroid clips out of view. I think Shiva thinks the object is out of the view frustum based on the center point, but this doesn't seem to make sense.
Any idea what would cause this or how to remedy? I have tried disabling visibility distance and removing occludable flags from the object, as well as changing the camera Z position (relative to the Skycar).
Thanks!
http://www.nebulacafe.com/dump/Clipping_issue.mp4
Anyhow, here's the issue. The asteroid platform which the Skycar is riding rotates via object.rotateAround(). The camera follows the Skycar very closely. When the asteroid (and the camera) make it about halfway through the orbit, in front of the rotation center point, the asteroid clips out of view. I think Shiva thinks the object is out of the view frustum based on the center point, but this doesn't seem to make sense.
Any idea what would cause this or how to remedy? I have tried disabling visibility distance and removing occludable flags from the object, as well as changing the camera Z position (relative to the Skycar).
Thanks!
NebulaCafe.com - SkyCars coming soon for iPhone and Android!Chat it up with fellow Shiva users: irc.shivaplace.com:16669 / #shiva
Re: Object clipping issue [video]
by NiCoX » 13 May 2011, 21:45
Hmmm... indeed looks like a bug...
If you select your object, and display the bounding volumes (hit 'b' in the SV), do they look correct? And do they "follow" properly the object?
Anyways, if you have an STE for me, do not hesitate to send me a PM
If you select your object, and display the bounding volumes (hit 'b' in the SV), do they look correct? And do they "follow" properly the object?
Anyways, if you have an STE for me, do not hesitate to send me a PM
-

NiCoX - Platinum Boarder

- Posts: 5626
- Location: France
Re: Object clipping issue [video]
by centry » 13 May 2011, 23:26
Your game is looking great! Funny thing is I'm making a game that is sorta like minigolf but with a space theme and it looks alot like your game! I even made an editor in a similar fashion to yours... 
- centry
- Expert Boarder

- Posts: 149
Re: Object clipping issue [video]
by Bryce » 14 May 2011, 00:07
Created another video to investigate bounding volumes. Pardon the crappy video encoding:
http://www.nebulacafe.com/dump/Orbit_bounding_volumes.mpg
Yes, bounding box values look normal for both the mesh object, subobjects, and the group itself.
It appears that when the object is fully in focus, the bounding volumes follow the object correctly. When partially viewport-clipped (maybe), it seems like the volumes become decoupled from the object and just stop moving. However, when I move the camera away from both volumes and the object, the bounding volumes reset their position to the correct location!
If this is not enough to solve the problem, please let me know. I can create a test-case .ste file if it helps; alternately I can send you a .ste with just the model.
http://www.nebulacafe.com/dump/Orbit_bounding_volumes.mpg
Yes, bounding box values look normal for both the mesh object, subobjects, and the group itself.
It appears that when the object is fully in focus, the bounding volumes follow the object correctly. When partially viewport-clipped (maybe), it seems like the volumes become decoupled from the object and just stop moving. However, when I move the camera away from both volumes and the object, the bounding volumes reset their position to the correct location!
If this is not enough to solve the problem, please let me know. I can create a test-case .ste file if it helps; alternately I can send you a .ste with just the model.
NebulaCafe.com - SkyCars coming soon for iPhone and Android!Chat it up with fellow Shiva users: irc.shivaplace.com:16669 / #shiva
Re: Object clipping issue [video]
by Bryce » 14 May 2011, 00:17
centry wrote:Your game is looking great! Funny thing is I'm making a game that is sorta like minigolf but with a space theme and it looks alot like your game! I even made an editor in a similar fashion to yours...
Thanks a lot!
Actually that's funny you say that; I also was working on a floaty-platform golf game in the past as well. About 5 years ago using Blitz Basic, called Cloud Nine Golf:

Anyhow, I'd like to check out your game as well, it sounds interesting.
NebulaCafe.com - SkyCars coming soon for iPhone and Android!Chat it up with fellow Shiva users: irc.shivaplace.com:16669 / #shiva
Re: Object clipping issue [video]
by NiCoX » 14 May 2011, 00:37
Are you putting the camera child of the platform, or the platform child of the camera?
-

NiCoX - Platinum Boarder

- Posts: 5626
- Location: France
Re: Object clipping issue [video]
by Bryce » 14 May 2011, 00:45
NiCoX wrote:Are you putting the camera child of the platform, or the platform child of the camera?
Nope and nope.
The camera has no parent. It loosely follows the Skycar. And the Skycar has no parent either, but is controllable. I essentially just drove the car onto the platform, had the camera follow, and then this happened.
NebulaCafe.com - SkyCars coming soon for iPhone and Android!Chat it up with fellow Shiva users: irc.shivaplace.com:16669 / #shiva
Re: Object clipping issue [video]
by redmotion » 14 May 2011, 11:09
What are settings of the platform that disappears?
is created at runtime (model instance) or in a scene?
I had this problem using the optimisation settings where if an objects centre disppeared out of camera the thing would pop out of existence. Needless to say, I decided not to use it!
is created at runtime (model instance) or in a scene?
I had this problem using the optimisation settings where if an objects centre disppeared out of camera the thing would pop out of existence. Needless to say, I decided not to use it!
Re: Object clipping issue [video]
by NiCoX » 15 May 2011, 12:51
Hi guys,
I just found the problem. This is due to an incoherency in the engine scene graph flags, caused by a call to shape.getBoundingXXX that partially flushes the graph (in order to resolve the branch we are querying). We'll fix that for next release. A workaround is to avoid calling shape.getBoundingXXX functions...

I just found the problem. This is due to an incoherency in the engine scene graph flags, caused by a call to shape.getBoundingXXX that partially flushes the graph (in order to resolve the branch we are querying). We'll fix that for next release. A workaround is to avoid calling shape.getBoundingXXX functions...
-

NiCoX - Platinum Boarder

- Posts: 5626
- Location: France
Re: Object clipping issue [video]
by Bryce » 15 May 2011, 17:43
NiCoX wrote:Hi guys,
I just found the problem. This is due to an incoherency in the engine scene graph flags, caused by a call to shape.getBoundingXXX that partially flushes the graph (in order to resolve the branch we are querying). We'll fix that for next release. A workaround is to avoid calling shape.getBoundingXXX functions...
Wow, you got to the bottom of that really fast! And you had to wade through my spaghetti code to find the source of the problem... not a small feat. I really appreciate you taking the time to resolve this issue: it's great news for me and SkyCars, but also great news for Shiva and its community.
Unfortunately, I can't stop using shape.getBoundingXXX because it's an integral part of my collision detection routine (as you may have seen). (I wrote my own collision and physics routines to optimize for mobile) I eagerly await the next release of Shiva!
NebulaCafe.com - SkyCars coming soon for iPhone and Android!Chat it up with fellow Shiva users: irc.shivaplace.com:16669 / #shiva
10 posts
• Page 1 of 1
