Ogre mesh weird shadows and disappearance when animated

Problems building or running the engine, queries about how to use features etc.
siondream
Kobold
Posts: 38
Joined: Tue Nov 24, 2009 7:54 pm
x 1

Ogre mesh weird shadows and disappearance when animated

Post by siondream »

Hi there!

I've been struggling with a Cinema 4D character and the I/Ogre plugin. With the creator's help I've managed to obtain the .mesh, .skeleton and .material files. When I load them in my code it seems everything is correct (see first photo). However, when I move the character and the camera, sometimes the shadow goes crazy (see second photo). The character is animated but when I start (for example) the "run" animation, the model disappears.

I've read the forum and something like this has happened before. It could be related to the character exceeding its own bounding box, duplicated vertices... Some people recommend Meshmagick but it crashes when I run it on my computer. I've attached my character in xml format in case you have a working Meshmagick or you want to check the problem out yourselves.

Of course, I've successfully loaded and animated other meshes like the robot mesh distributed along Ogre using the same code.

Thank you very much!

Image
Image
You do not have the required permissions to view the files attached to this post.
siondream
Kobold
Posts: 38
Joined: Tue Nov 24, 2009 7:54 pm
x 1

Re: Ogre mesh weird shadows and disappearance when animated

Post by siondream »

Seriously, nobody can help? I'm quite desperate around here :(

I've build and installed meshmagick in Ubuntu 10.10 but it crashes because it can't find libmeshmagick.so.0.

Code: Select all

david@siondream:~/siontower-0.1-demo-src/media/meshes$ meshmagick optimise personaje.mesh.xml 
meshmagick: error while loading shared libraries: libmeshmagick.so.0: cannot open shared object file: No such file or directory
libmeshmagick.so.0. is located in /usr/local/lib but I've put links in meshmagick executable folder (usr/local/bin) and working directory (~/siontower-0.1-demo-src/media/meshes) unsuccessfully.
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218

Re: Ogre mesh weird shadows and disappearance when animated

Post by Jabberwocky »

So you have two problems, right? One with shadows, and one with animation?

I downloaded your model, loaded it into OgreMeshy (a mesh viewer - maybe you can get that to run on Ubuntu?), and the mesh and bounding box looked correct. When I started an animation, the model disappeared as you described. So obviously the animations are borked. This might also be causing your shadow problems.

You can view the bones in OgreMeshy by clicking the "show bones" button in the toolbar. While the animation was set to "none", the bones looked correct. Then when I started the animation, the model disappeared, and all the bones collapsed into a tiny dot. This led me to inspect personaje.skeleton.xml, where I noticed this:

Code: Select all

						<keyframe time="0.00000000">
							<translate x="-0.00001611" y="-0.00003084" z="0.00000605" />
							<rotate angle="0.51281846">
								<axis x="0.00000030" y="0.00000004" z="-1.00000000" />
							</rotate>
							<scale x="0.00000006" y="0.00000012" z="0.00000012" />
						</keyframe>
Notice the tiny scale values. The animations are causing your model to be shrunk down into a tiny size. You'll need to fix that, it should probably have scale values of 1,1,1. It's like your animations are getting exported at a fraction of the size of the model. I know nothing about Cinema 4D, but perhaps there is some kind of scale modifier being applied to your model which is screwing things up.

Fix that, and see if by any chance your shadow problems get fixed as well.

If not, I'd suggest searching through the forums, there are many, many posts on shadow issues. Provide as much detail as you can in your search terms, e.g. "shadow stencil" or "shadow texture integrated additive" depending on your shadow setup.

If you don't find anything, you'll need to post more details of your shadow setup in your help post. If you're using custom shaders, help might be hard to come by, as they are notoriously hard to debug, particularly from just a forum post.
Image
User avatar
Spanki
Halfling
Posts: 76
Joined: Fri Jun 06, 2008 5:58 am

Re: Ogre mesh weird shadows and disappearance when animated

Post by Spanki »

Hi Jabberwocky,

I just recently added <scale> record export... my understanding was that they should be treated as "delta" scaling values (ie. just like the <translate> and <rotate> keyframe records are deltas from the base bone values)... am I wrong on this assumption? Should these be absolute values?

Thanks,

Keith (I/Ogre C4D plugin developer)
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218

Re: Ogre mesh weird shadows and disappearance when animated

Post by Jabberwocky »

Hey Spanki,
Ahh, that explains it! Yeah, they're absolute values.
Image
User avatar
Spanki
Halfling
Posts: 76
Joined: Fri Jun 06, 2008 5:58 am

Re: Ogre mesh weird shadows and disappearance when animated

Post by Spanki »

"D'oh!" ~head-slap~

Thanks :).