realbasic-games
[Top] [All Lists]

Re: Tearing in trimesh morphs

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Tearing in trimesh morphs
From: Jeff Quan <jquan at mindspring dot com>
Date: Thu, 9 Feb 2006 13:58:49 -0800
Delivered-to: realbasic-games at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=mindspring.com; b=a7RCzqqLIB50BUfEN05KBBQAtYfCcx+Xyw5qQVW406eQjtoKD9H2rHyGbSw/rmNB; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:From:Subject:Date:To:X-Mailer:X-ELNK-Trace:X-Originating-IP;
References: <AD2720A3-FE2D-43AB-A346-B11C9EAF0B19 at mindspring dot com> <a0620073bc0115bf6e836 at [10 dot 0 dot 1 dot 13]>
On Feb 9, 2006, at 1:02 PM, Joseph J. Strout wrote:
You can't interpolate the normals that way; at a minimum, you'd need to normalize the normals, but I'm not sure that they would be right even then. Try that first, and if it's still not working, then you may need to recalculate the normals from first principles (e.g., by averaging the normals of all triangles it's involved in, and then normalizing) on each frame.

Oops --that's what I get for paying too much attention to the world "vector" in VertexNormals.SetVector!

The only way I can get it to work correctly is to set RenderBackFaces=True, which seems more work than necessary. It appears to me as if the triangle normals aren't updating. Is there a way to do this?

Are you seeing triangles actually disappear on some frames? If so, then that implies that it's the triangle normals that are wrong, not the vertex normals (as you just said). I'm hoping that's not what it is, though, because I don't think you have any access to those -- they're usually computed internally.

Yes, some triangles are disappearing. It looks to me as if the normals from the very first pose are being kept through subsequent morph targets, so that when I see a triangle change it's normal facing from, say, down to up the triangle disappears for the duration that it stays up. Renderbackfaces allows the triangles to be visible all the time, but it will probably result in incorrectly-lit triangles.

What's odd to me is that if I switch to wireframe, I can see that the disappearing triangles are actually facing the correct way and thus should be visible. I'm assuming that the RB3Dspace treats triangles the same way as I see 'em in Meshwork: if a triangle is flipped away
from the camera, it's not visible in either rendered or wireframe views.


But if it's not the triangle normals, then I can't imagine what RenderBackFaces would have to do with it. On the other hand, we have morphing models in Renegades (e.g. the boss bot at the end), where we twiddle the vertex positions and normals, and that seems to work fine, without worrying about triangle normals. So I wonder what's different about what you're doing?

Erm, unless I'm mistaken, the boss at the end doesn't morph via trimesh modification. It does it by carefully keeping track of each leg joint's position and orientation for both upper and lower leg models.


I suppose the best next step, if simply normalizing the interpolated normals doesn't solve it, would be to try to reproduce the problem in a simple example. If you can do that, I'll look at it, and maybe we can drag Frank into it too, and I bet we can come up with a solution.

The normalizing doesn't help. I'll work up something for you.

==
Jeff Quan
jquan at mindspring dot com
http://www.geocities.com/jeffqportfolio/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>