jrmuizel / o3d

Automatically exported from code.google.com/p/o3d
0 stars 0 forks source link

Skinned mesh culling #173

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Following defect #159, I got latest converter (2009/10/06) and o3djs
library, now translation on my loaded skinned mesh is OK, but ...

test1_avatar.html provided into the attached zip file
1. open 1 skinned mesh .o3dtgz file
2. rotate camera to test culling

What is the expected output? What do you see instead?
mesh seem to have 0 sized axis aligned bounding box and is culled when view
frustrum is just above/below/onleft/onright of the local origin of the mesh
(ie. foot)

What version of the product are you using? On what operating system?
O3D converter + o3djs lib (2009/10/06)
Windows vista

What hardware are you using:  graphics card type?  motherboard type?
PC
nVidia 8600M GT

Please provide any additional information below.

Original issue reported on code.google.com by gregory...@gmail.com on 8 Oct 2009 at 10:31

Attachments:

GoogleCodeExporter commented 9 years ago
Just FYI, 2 quick fixes

1) Turn off culling for the skinned primitive.

mySkinnedPrimitive.cull = false

or

2) Manually set the bounding box for the skinned primitive

mySkinnedPrimitive.boundingBox = [
  [mixXInLocalSpace, minYInLocalSpace, minZInLocalSpace],
  [maxXinLocalSpace, maxYInLocalSpace, maxZInLocalSpace]
];

The truth is, O3D has no way of knowing how the application is going to animate 
the
skinned model and computing a new bounding box on the fly would be too slow. 
Most
games manaully set the bounding box to a box that is large enough to cover any 
state
of animation the game expects. That means that even if this gets fixed you'd 
still
need to implement solution 1 or 2 above for your app.

Original comment by g...@google.com on 11 Oct 2009 at 6:10

GoogleCodeExporter commented 9 years ago
Thank you gmangoog,

I solved temporarly by disabling culling and I will
follow your advice by setting up a maximum bounding box
according to animation.

I understand that it s difficult to compute minimal size.

Bye
greg

Original comment by gregory...@gmail.com on 11 Oct 2009 at 7:34