PDA

View Full Version : Quads to Tris



Chris Jones
10-12-2011, 12:12 AM
Hey all,

Anyone know of a way to control the way a sub-d object is subdivided into tris at render time (and OpenGL display time)? For example, if I want to create a ridge diagonally across a grid of quads, the results can be ugly if the polys are predestined to be split diagonally in the other direction. This is most obvious when converting to tris in modeler, as in this pic:

http://forums.newtek.com/attachment.php?attachmentid=98628&stc=1&d=1318395986

Seems like there should be a way to re-orient the tris that are "hidden" in the quads.

As an aside, I also noticed the following display discrepancy while trying to illustrate the above issue.

1 Select points diagonally
2 Moving points in Y creates pyramids
3 Triple, and a ridge is created (instead of pyramids)
4 Same thing in the opposite direction shows a ridge
5 Triple, and pyramids are created (instead of a ridge)

http://forums.newtek.com/attachment.php?attachmentid=98627&stc=1&d=1318392831

Thanks for any help,

(c:

probiner
10-12-2011, 01:13 AM
thread (http://forums.newtek.com/showthread.php?t=86549) talking about this
(the plugin refered there it's this one (http://www.lwplugindb.com/Plugin.aspx?id=7d7c04f0))

Anyway try to apply these commands to your model just for testing:
- Select all polygons
- Unweld Points
- Triple Polygons
- Merge Polygons
- Apply (Normal Corrector (http://www.lwplugindb.com/Plugin.aspx?id=20e5fbf4)) Plugin. (If you have normals being displayed you will notice the change)
- Merge Points. And now you are back to the start but the normals have been recalculated.
- Triple to see if the results are closer to the expected.

This of course works if you triple in modeler and probably only for steep angles, but with the Layout, first polys are subdivided and then tripled, so you got no control of the orientation as far as I know =(

Good Luck

Chris Jones
10-12-2011, 06:12 AM
Hey thanks for digging that up probiner. I read through the thread and that first lscript you linked to seems to be the sort of thing I'm after - except that I couldn't get it to do anything... :stumped: I also tried the steps you suggested on a model I'm working on, but ended up with the tris back the way they were to begin with. Of course if it can't be controlled in Layout then it's all a bit of a lost cause anyway I suppose. Thanks for the suggestions though!

Greenlaw
10-12-2011, 07:44 AM
Is it absolutely necessary to keep the entire mesh in all quads?

What I do is split only the polygons where I need an edge like that and guide the 'split' to flow where necessary. I find this easier, efficient and gives me predictable results.

G,

probiner
10-12-2011, 10:39 AM
Hey thanks for digging that up probiner. I read through the thread and that first lscript you linked to seems to be the sort of thing I'm after - except that I couldn't get it to do anything... :stumped: I also tried the steps you suggested on a model I'm working on, but ended up with the tris back the way they were to begin with. Of course if it can't be controlled in Layout then it's all a bit of a lost cause anyway I suppose. Thanks for the suggestions though!

Normally tripling will make a diagonal from point #2 to point #4. What that LScript (http://www.neko.ne.jp/~asagi/P2P/LScript/mod/ChgPntOrder.ls) will do it's change the point order of the quad, so you can "spin the edge" before actually tripling.

Also if you notice the X axis will have its influence. The image shows a square sudvidided in different X axis positions and then tripled.
So to have consistent tripling just pick one side of the X axis, subdivide and triple. Squares made in the X=0 plane (Right View) will be always consistent with the +X orientation.
http://i153.photobucket.com/albums/s202/animatics/tripling.png

Cheers

Chris Jones
10-12-2011, 04:34 PM
Is it absolutely necessary to keep the entire mesh in all quads?

What I do is split only the polygons where I need an edge like that and guide the 'split' to flow where necessary. I find this easier, efficient and gives me predictable results.

G,

Normally that's what I would do, but in the case of skin moving over muscle/bone I need quads that are going to be deformed diagonally on occasion.


Normally tripling will make a diagonal from point #2 to point #4. What that LScript (http://www.neko.ne.jp/~asagi/P2P/LScript/mod/ChgPntOrder.ls) will do it's change the point order of the quad, so you can "spin the edge" before actually tripling.

Also if you notice the X axis will have its influence. The image shows a square sudvidided in different X axis positions and then tripled.
So to have consistent tripling just pick one side of the X axis, subdivide and triple. Squares made in the X=0 plane (Right View) will be always consistent with the +X orientation.

Ok, I tried shifting the object on X, but unlike your example, my tris are staying uniformly oriented. Some more experimenting and I think I've figured out why.

If I just make a cube with predefined segments and hit triple, all the tris are oriented in the same direction no matter where it is on X. Same thing if I make it into a subpatch. The LScript doesn't work in this situation either. It only works if I "subdivide polygons" first, which effectively quadruples the polygon count (which is far from ideal).

On the other hand, I've just tried this on a pre-existing model and that's not working either, so something else must be at play. Hmmm...

Thanks again for the replies.

probiner
10-12-2011, 05:22 PM
predefined segments and hit triple, all the tris are oriented in the same direction no matter where it is on X.

The LScript doesn't work in this situation either. It only works if I "subdivide polygons" first, which effectively quadruples the polygon count (which is far from ideal).


Well with predefined segments you will have uniform direction. I was talking about subdivided geometry, not geometry made with divisions. The same won't happen if you for example Array a single square. But the "subdivided" command is commonly used.

Well the Lscript won't work, the same way as we know we can't do anything about Layout subdivision and the tripling.

Can you share a model?

Hopefully someone with more understanding will stop by =)

Cheers

Chris Jones
10-12-2011, 05:39 PM
Here's a piece of the object in question.
(c:

probiner
10-12-2011, 06:26 PM
So I opened the object... and it's not with subdivision =P And it's kind of hard to understand what you want.

The Lscript works per polygon patch, meaning, that the tripling orientation will be affected by polygon, just like the Adaptive Subdivision. So, if you use it on a quad and change to Layout OpenGL Wireframe you will see a change of orientation.

What I would guess that you want, or at least what I see that could be better in this area, is that LW would do an intelligent tessellation in a way it would subdivide and orient the tripling the best way the shape demands, just like Adaptive Subdivision should not be a globabl ammount per polygon, but put more geometry where it's needed.

It's up to development I think. So I guess turns into a feature request: New tessellation method for subdivisions =) I wonder how this is done in XSI for example (pooby you're there?)

Sorry if I went far off of your problem and only made noise. Cheers

Chris Jones
10-12-2011, 07:42 PM
So I opened the object... and it's not with subdivision =P

If by subdivision you mean sub patch/subdivision surface (terminology is getting confusing :P), the way the tris are oriented when tripling seems to be generally the same whether it's sub-ds or normal polys.

I find that when making a box from scratch, then subdividing it with "subdivide polygons", the LScript works visibly in Modeler, as does moving the object in X - whereas with my test object it does not. But yes, on second inspection it does seem to work in Layout (even when using an object with pre-defined segments).

So perhaps that's a partial solution after all. Now if only there was a way to view the results within Modeler as well... I also wonder whether these modifications to the point order would be translated correctly in other software.


What I would guess that you want, or at least what I see that could be better in this area, is that LW would do an intelligent tessellation in a way it would subdivide and orient the tripling the best way the shape demands, just like Adaptive Subdivision should not be a globabl ammount per polygon, but put more geometry where it's needed.

That sounds ideal.


It's up to development I think. So I guess turns into a feature request: New tessellation method for subdivisions =) I wonder how this is done in XSI for example (pooby you're there?)

Sorry if I went far off of your problem and only made noise. Cheers


It's all good, thanks for the help!