Is it a bug or is it me ?

Report any Bugs you've found in JPatch here. IMPORTANT:Please post bugs found in a beta or development version into the Beta forum!

Is it a bug or is it me ?

Postby dphamhi » Sat Feb 04, 2006 10:22 am

Hi everyone !

I modeled a gorilla in Hamapatch then I imported in Jpatch version 0.4 . I attach the kong.jpt file to this post.

It has half of the patches wrongly aligned. At 1st I thought it was because some of the 5-point patch in Hama dis not come through so I made these again in Jpatch. But, selecting all the points and doing "align patch" doesn't do anything.
I tried by flipping one by one some patches to make a majority in the right alignment, but no result. I tried to plug some of the holes. Again I could not align the patches all together in one maneuver. I had to go about it and flip patch by patch.
Is there a way to do it faster ?
Is it a bug or not ?
Is there any recommendation ? because when I tried to build a sphere by joining 3 circular splines having 4 points each (one equator and 2 meridians) agian , totally natively in Jpatch, I had half the patches wrongly aligned.
So this is not an importer issue.
Should I add points clockwise ? counterclockwise ? use only "loose-ends, 4-points sticks and join them with the not-ending points ?

Thank you !
Duke
Attachments
kong.zip
patches wrongly aligned, but cannot re-align them.
(4.08 KiB) Downloaded 371 times
~ dphamhi ~
dphamhi
 
Posts: 21
Joined: Mon Aug 23, 2004 8:40 am
Location: Paris

Postby dcuny » Sat Feb 04, 2006 7:10 pm

Yeah, Sascha will want to see this one. ;)

It looks like JPatch can't figure out which direction the face's normals are supposed to be pointing.
Attachments
kong.png
kong.png (23.73 KiB) Viewed 7797 times
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby squirrelhavoc » Sat Feb 04, 2006 8:15 pm

Those spots almost look like overlapping patches, one facing forward, the other backwards
Squirrel Havoc

We live as we think, very very slowly....
squirrelhavoc
 
Posts: 180
Joined: Tue Jun 28, 2005 11:17 pm
Location: Oklahoma, USA

Postby dcuny » Sat Feb 04, 2006 8:52 pm

I think that's a reasonable explanation - it explains why some of the degenerate patches appear and disappear when you spin the model. Did it export double-sided patches?

Playing with the CVS version shows some oddities - for example, there's a seam along the back that isn't joined properly.

There used to be a "remove patches" option, but I can't seem to find it, or I'd just remove all the patches and rebuild them. :?
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby squirrelhavoc » Sat Feb 04, 2006 8:53 pm

Last time I checked, the remove all patches button was under the tree view, with all the other buttons
Squirrel Havoc

We live as we think, very very slowly....
squirrelhavoc
 
Posts: 180
Joined: Tue Jun 28, 2005 11:17 pm
Location: Oklahoma, USA

Postby Guest » Sun Feb 05, 2006 12:59 am

dcuny wrote:I think that's a reasonable explanation - it explains why some of the degenerate patches appear and disappear when you spin the model. Did it export double-sided patches?


I would say not, because If I select the patch that is degenerate and delete it, it dissapear completely. It does not reveal another patch underneath it . I verified with both render options "highlight backface" and "cull backface"


dcuny wrote: Playing with the CVS version shows some oddities - for example, there's a seam along the back that isn't joined properly.


Because I wanted Kong to be symmetric, I built half of it , including the section border contour (at x=0) . So after I cloned it and mirrored it and weld the frontier points together, I guess some edges were still there.

However, as I told in my first post, this alternate patch face is not specific to this model: If I made an 6-point ellipsoid ( like a football ) then created 4 points at midway of the 4 meridians coming from one end , then create splines to join these 4 new points (creating one "latitude" parallel to the equator) , the new faces will still alternate .

Thanks for having looked at it.
Guest
 

Above post

Postby dphamhi » Sun Feb 05, 2006 1:01 am

... is from me.
I'm sorry, forgot to log in before replying to David and Squirrel Havoc .
~ dphamhi ~
dphamhi
 
Posts: 21
Joined: Mon Aug 23, 2004 8:40 am
Location: Paris

Postby pndragon » Sun Feb 05, 2006 7:31 am

What the problem seems to be is multiple patches occupying the same space. This can be seen by the multi-attached point color at inappropriate places.

I had a similar problem with my dragon (http://forum.jpatch3d.org/viewtopic.php?t=278). The only thing that you can do at the present time is to go through your model and check for duplicate splines and patches and repair the model by hand.

--- Jim
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Postby pndragon » Sun Feb 05, 2006 8:14 am

All of the extra splines and patches were along the central spline. I suspect the extra splines were added during hamapatch's mirror function

--- Jim
Attachments
aligned_kong.zip
(3.32 KiB) Downloaded 380 times
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Postby sascha » Sun Feb 05, 2006 8:49 am

It looks like JPatch can't figure out which direction the face's normals are supposed to be pointing.

No, JPatch doesn't even try to figure that out, no matter if you import your model or make a new one with JPatch.

The reason for this is simple - the patch-finding code was written before version 0.3 - and patches have a front- and back- side only since JPatch 0.4.

This has two consequecnes:
Firstly, if you wan't to have the patches algined, you have to do it manually. Don't worry, there's a tool called "auto-align patches" that (in most cases) makes this task pretty simple.
Check out the section about aligning patches in the JPatch 0.4 reference manual.
If you use the auto-mirror tool, be sure to use it the right way - thery's also a section about it in the same manual.

Secondly, you may ask why you need to align patches in JPatch 0.4 (while version 0.3 didn't even have this featues). The reason is that JPatch 0.3 only supported output as bicubic patches, which is experimental and has sevaral problems - e.g. 5-sided patches and hooks will cause creases in the surface when exported as bicubic patches. Since I'm not sure if this problem can be solved (and even if it can, it's beyond my math skills), I decided to implement another subdivision scheme for version 0.4 - quite similar to "Hash-Patches".
To get smooth surfaces, this new method tesselates the patches into triangles or quadrilaterals, and then averages the surface normals for each vertex. For this to work, the surface normals have to point in the same direction, thus the patches must be aligned.

Long story short: If you export to bicubic patches, you won't need to align the patches. You can configure JPatch's editor to not highlight or cull backfacing patches.
Future features (like fur) will need the patches aligned, so its a good idea to align them anyway. But I plan to modify the patch-finding code to automatically align patches. In the meantime, you can use the "auto-align-" and "flip-" patches tools to do it manually.

As pndragon pointed out it looks like your model had several coincident splines. I'm not really familiar with hamaPatch, so if this happened during mirroring im hamaPatch try to use JPatch's auto-mirror feature. When used properly (check out the documentation) it will correctly attach the two sides of the model automatically.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby sascha » Sun Feb 05, 2006 10:08 am

A few more things :)

The problem is indeed caused by multiple coincident patches (caused by coincident splines). It's nearly impossible to find and delete all coincident splines when manually "mirroring" a model (i.e. modeling one side, mirror it and connect the two halfs). That's exactly the reason why I wrote the auto-mirror tool :wink:
In the latest development version, the auto mirror tool not only mirrors the geometry, but also morphs, bones and poit-to-bone assignments (it's quite experimental though).

It's almost impossible to select only one of the coincident patches. The reason for that is that you can't select patches directly - a patch is selected if all it's corner control-points are selected. So, if you select the corner points, you'll automatically select both of the coincident patches.

A good indication is the color of the controlpoints. A controlpoint that is attached to one other point is colored red - this is the normal case (whenever two splines cross).
If more that two splines cross (more that two points are attached), JPatch will render the points as larger orange squares. This is not always an error, but if you spot an orange dot you should carefully examine it. If it appears on a flat part of the surface then there's something wrong. Either it's a corner of an inappropriately used three-point-patch (this can be resolved with 5-point-patches or hooks) or (like in your case) there are coincident points.

In most cases the quickest way to fix this is to delete the points in question and re-attach the splines again manually.

For future versions, I plan to add a better visual indication of coincident splines - perhaps I can even find a way to automatically correct them...

Ok, I hope this explaination is of help. If you have further problems or questions feel free to ask!
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby dphamhi » Sun Feb 05, 2006 10:36 am

sascha wrote:A few more things :)

For future versions, I plan to add a better visual indication of coincident splines - perhaps I can even find a way to automatically correct them...

Ok, I hope this explaination is of help. If you have further problems or questions feel free to ask!


OK thanks Sascha and Pndragon and you all . The explanation of how the patch alignment works helps enormously.
I understand that . I will test by importing half-Kong into Jpatch before auto-mirroring it.
Will report if anything interesting .

BTW I'm very much looking forward to animating this Kong with bones in v. 0.5 !

Thanks again
~ dphamhi ~
dphamhi
 
Posts: 21
Joined: Mon Aug 23, 2004 8:40 am
Location: Paris


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron