POV-Ray : Newsgroups : povray.general : Boned mesh file formats? : Re: Some answers Server Time
2 Aug 2024 22:15:36 EDT (-0400)
  Re: Some answers  
From: andrel
Date: 27 Aug 2004 16:41:58
Message: <412F9C4B.40207@hotmail.com>
Sascha Ledinsky wrote:

> Rune wrote:
> 
>> Sascha Ledinsky wrote:
>>
>>> You will need at least *something* - take, for example, an arm or leg
>>> of a human model: If it bends to the maximum allowed angle (let's say
>>> 170 degrees), the upper and lower parts would intersect
>>
>>
>>
>> Not necessarily if the vertices around the joint moves by an average 
>> between
>> the two bones. I think.
>>
> 
> Smoothly blending between two bones is nice to have too, but it doesn't 
> really solve the problem. Morphs on the other hand have more advantages 
> - you can easily fake muscle motion and also doo facial expressions, 
> lip-syncing, etc...
> 
>>> I'm about to implement it in my modeler (which used a spline based
>>> approach and outputs bicubic patches to pov-ray), and use an xml-style
>>> file format...
>>
>>
>>
>> That sounds interesting. I'm curious, how have you managed to get 
>> around the
>> topology problem with bicubic patches?
> 
> 
> Currently three sided patches are handled as degenerate rectangular 
> patches, and five-sised ones are represented by five rectangular patches 
> (I will treat the three-sided case similar once I've a better 
> implementation). Currently both versions suffer from creases (which are 
> visible on reflective sorfaces or surfaces showing sharp specular 
> highlights). Here is an example image, modeled with my modeler and 
> rendered with pov-ray:
> http://www.jpatch.com/gallery/head.jpg
> 
> I have not yet solved the problem, but I am sure there is a solution. I 
> have found a paper which explains how to convert a bezier triangle into 
> four regular bicubic patches. The patches connect seamlessly (with G1 
> continuity). I'm quite sure a similar solution exists for five-sided 
> patches - I've found the (mathematical) conditions for connecting 
> patches with G1-continuity in a book about curves and surfaces, I try to 
> apply it to my problem (causing me some headaches, as I'm not a 
> mathematician :-/ ...)
> 
>> and I've never seen three bicubic patches sharing one
>> corner fit seamlessly together. Well, seamlessly I have seen, but not 
>> with a
>> completely smooth surface...
> 
> 
> As I mentioned above, it is possible (see the code at the end of this 
> post) - it converts a bezier triangle into three "pov-ray compatible" 
> patches. Bezier triangles are not exactly what I need for my three- (or 
> five-) sided patch, but it's a start ;-)
> 
>> I'd be interested in hearing more about your plans and the format.
> 
> 
> I'll let you know when it's ready...
> 
> Here's the code:
[snip]

You did not explain what your macro does, and it is a bit hard
to follow without comments but here is what I think you are doing:
Lets call the corners A,B, and C. You split the triangle in three 
patches. One with corners: A, the middle of A and B, the middle
of A and C, and the centerpoint. Then you compute the remaining
points as functions of the originally given points. I can only
assume that the math is correct ;)

For POV to render these without cracks, you also have to
make sure that the division in triangles, as controlled by
u_step and v_step is the same in the patches in the triangle
and in the adjacent quad patches. This simply means that
in the triangle they have to be one lower then outside.
I think that it also forces a flatness of zero in the entire
set of patches. You have to be certain that the edges of
adjacent patches edges are split in the middle, so they
have to have flatness=0 and therefore their neighbours
also etc.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.