Hey Fabrice,
thanks a lot for your extensive explanation!
I tried to implement the stuff you wrote, but some things are still
not clear to me.
On 18 Feb., 17:08, Fabrice <[email protected]> wrote:
we are talking sphere primitive here
the median that goes down left to top right is the one you want.
you need the face thats shares the two vertexes of that side.
on this primitive you have 3 possible candidates 01, 12, 20
they are left, right, top or down of your face
Ok, I understand. So I need to find the neighbour, that makes up
the square togehther with the tri I'm currently rendering.
eliminate first the one you don't need. the one that is up or down of
your face.
you know this because 2 of your uv's or vertexes are sharing same y
or
v value.
then because the sphere is builded in a rotating fashion, you
eleminate the second one using the third vertex
not shared by checking the uv.u.
Ok, done.
I wrote a clumsy, but working, method that returns the corresponding
neighbour for the given tri.
I used the uv values to find the correct candidate like you described.
That works!
now the second tri.
same process, but reversed
This is the first point I don't understand. What second tri?
I thought I just have to search for the face, that shares the
median from bottom left to top right for the tri I'm rendering...
as i understand it, there is only one neighbour which fulfils that
requirement.
With which tri should I do the process of finding the corresponding
neighbour?
there you go, you have the face you need if you now average the
normals of the two faces shared vertexes.
I should build the average of the two vertextes that my tri and it's
neighbour are sharing or the average of the normals of the two faces ?
so if you now use only the third normal(not shared) + the two average
normals you just found, it might give what you want.
By "the third normal" you mean (e.g. v0 is the "not shared" vertex):
tri.faceVO.face.vertices[0].position.normalize(); ?
And the other two normals are the shared vertexes, like ?:
tri.faceVO.face.vertices[1].position.normalize();
tri.faceVO.face.vertices[2].position.normalize();
If so, I don't understand why I have to search for the neighbour,
because
now I just have the three vertextes that make up my tri... that can't
be
true - what am I missing here?
The other question is:
After this is all done, use the three normals where?
I guess in this piece that looks like that right now:
norm1.rotate( tri.faceVO.face.parent.neighbour01
( tri.faceVO.face ).normal, t );
norm2.rotate( tri.faceVO.face.parent.neighbour12
( tri.faceVO.face ).normal, t );
norm3.rotate( tri.faceVO.face.parent.neighbour20
( tri.faceVO.face ).normal, t );
I use my three new normals instead of the normals for n01, n12 and
n20. Is that
right or am I totally wrong now?
Fabrice, thanks a lot for you patience and it would be great if you
could enlighten
me once more ;)
Thanks and greetings,
Spog