PDA

View Full Version : Any way to improve the internal triangulation of cinema?


vinced
05-24-2008, 05:26 AM
Hello everyone,



my question:

Is there any way to improve the internal triangulation of cinema ?



I`m doing my modeling in MOI (http://moi3d.com (http://moi3d.com/)) which by the way is a really great companion to c4d. The meshes I get from MOI after exporting them to wavefront are really clean, but cinema (as far as i have understood) has problems with triangulating some 5-point n-gons.

Cinema is doing the triangulation as if it is a 4-point n-gon and the result is, that there remains a degenerated n-gon, which makes problems during uv-mapping.



Michael Gibson (the developer of MOI) has explained to me what is going wrong.

Please have a look at this thread:



Michaels explanation:

http://moi3d.com/forum/index.php?webtag=MOI&msg=1620.11



The whole case ;) :

http://moi3d.com/forum/index.php?webtag=MOI&msg=1620.7



Is there any way to improve the internal triangulation of cinema or any work around?



I also would like to fill out a suggestion form at maxons site, but i`m not sure if i`m able to explain it in a way to make them understand and I don`t know if they need my files for checking.



Maybe Björn could note down these things in a way their programmers need it or Keith could address this problem in his Riptide-plugin?



Thanks for your answers.



Greetings

Dirk:)

LucentDreams
05-24-2008, 05:58 AM
why not just include the links in your suggestion?

That said Michael couldn't be more wrong about how cinema handles its triangulation and guessing of your pics is pointless because every time you move a point you modify how the traingulation will work since cinema's ngon triangulation is dynamic, thus always finding the best method depending on the position of the points as the points move its updating and generating the triangles in a new way. I his example you get exactly how he suggests the ideal should be if you want to see for yourself turn on the Ngon triangulation display in cinema, its the first thing you should do when working with ngons if you don't plan on getting rid of them in the end.

vinced
05-24-2008, 07:38 AM
Thanks for your answer Kai.

“why not just include the links in your suggestion?”
What about the files? Do they need them also?:rolleyes:

“every time you move a point you modify how the traingulation will work”
That does not work in my version of cinema(R 10.5). I am moving the points while I write here. The triangulation doesn`t change at all.:hmm:

“turn on the Ngon triangulation display in cinema”
You mean the function below the menu “tools”(I guess it is called “tools” in the English version)?

I can`t notice any effect from clicking on ngon triangulation and the cinema help file doesn`t give me any usefull information about what this function does.


Sorry Kai, i can`t really follow you here. Maybe my English is not good enough. From what you wrote it sounds like you have the solution for me, but I didn`t really understand what I have to do.:rolleyes:


Greetings
Dirk:)

rareseu
05-24-2008, 07:49 AM
the triangulation chenges, maybe you are not making the changes drastic enough, cut an edge of the ngon you'ee it chenge
the ngon triangulation is in the viewport properties

vinced
05-24-2008, 08:58 AM
Thanks rareseu,

now i`ve found the n-gon-triangulation and can actually see how cinema triangulates the n-gons.

Can i tell cinema in a fast way how it should triangulate the n-gons?
Something like: not this one,... not this one... yes, that one.:)

I know i could triangulate it by hand, but if the model gets more complicated that`s not much fun.

Dirk

ThirdEye
05-24-2008, 09:45 AM
Functions > Retriangulate Ngons. Obviously it works with selections.

Keith Young
05-24-2008, 05:10 PM
This image shows the issue he's talking about. I've scaled it up and exagerated the offset of the two selected vertices to help visualize it. The thing to note is 'how' that single Ngon got triangulated.

An 'optimal' (or at least a quad-optimal) triangulation for this non-planar Ngon would have been a split between the two selected vertices, resulting in an upper and lower quad, instead of a single quad in the center, with a triangle on each end.

To answer Dirk's question, no.. you can't tell C4D 'how' you want it triangulated, aside from just cutting the split in there yourself with the Knife Tool (Retriangulate Ngons just gives the same result again, in this case).

rareseu
05-24-2008, 05:58 PM
it works for me Keith , i tried again the same thing and it came out like yours :| , i don't think the example is good tho , because you can easily create 2 nice quads there would be no point in leaving it as an ngon

Keith Young
05-24-2008, 06:28 PM
it works for me Keith , i tried again the same thing and it came out like yours :| , i don't think the example is good tho , because you can easily create 2 nice quads there would be no point in leaving it as an ngon

I agree, but the problem is:

he's creating the model in MoI - where the Ngons are being generated.
he's then using my Riptide plugin to import the .obj file...
...Riptide basically asks C4D how to triangulate it (this took a lot of effort to implement and finally fixed all my 'concave' Ngon issues)
so, he ends up with the situation shown.
...there are 4 ways to fix this, from my perspective (least desirable first to most desirable last):

have me spend a lot of time re-coding my Ngon triangulation code (probably not going to happen).
manually knife in the edges you want, after importing (tedious).
don't export Ngons from MoI - use it's triangle/quad export option, so the triangulation is done in MoI instead of C4D (most attractive current option).
use method 3 until Maxon comes up with some other solution.

Keith Young
05-24-2008, 06:34 PM
Just as an aside... to rule out that the issue could be rooted in Riptide, I started with the Ngon in my image above, deleted the Ngon (leaving the points in place), then used the Create Polygon tool to re-create the Ngon - it always came out with that same triangulation, regardless of which vertex I started from.

As I mentioned earlier, Retriangulate Ngons also produced the same result (for that particular Ngon/vertex set). This means that C4D would always give that particular triangulation for that particular set of vertices.

Keith Young
05-24-2008, 06:40 PM
Just as another aside :)...

I'd also note that C4D's triangulation shown above is not 'bad' or 'incorrect' - it's a perfectly valid way to split up that Ngon into multiple planar polygons. The only issue at hand is whether that particular triangulation is the 'best' way to do it, in some particular situation (and/or whether there was an easier option to use alternate triangulations - kinda like how a 'Spin Poly' tool might work).

In this particular case, a 'better' triangulation (with regards to issues in BodyPaint, with uv-mapping) could be found.

vinced
05-24-2008, 07:08 PM
Hi Keith and rareseu,

i`ve just mailed the situation to maxon support, so they are aware of it now and I hope they will address this in a future-update.

I have directed them to this thread here and the thread over at MOI-forum, cause this is a better way than me explaining them where`s the problem.:sad:


Now they may decide if it`s a bug or a feature.:p



Thanks Keith for your effort:thumbsup:

Keith Young
05-24-2008, 07:28 PM
Just for completeness, an arguement could also be made that MoI should not be 'generating' non-planar Ngons (it sounds like you used the bevel tool or something to get that mesh). On the other hand, the issue may not be due to it being non-planar, it might just be a function of the way the C4D triangulator works in either case.

LucentDreams
05-24-2008, 07:28 PM
well when you pull the point outwards then it triangulates as shown in your example, but the original discussion was about a point that was still flush and in that case the triangulation changes (hence the dynamics triangulation I referred to) and matches the example form the Moi developer.

Keith Young
05-24-2008, 08:02 PM
well when you pull the point outwards then it triangulates as shown in your example, but the original discussion was about a point that was still flush and in that case the triangulation changes (hence the dynamics triangulation I referred to) and matches the example form the Moi developer.

Actually, I just moved all the points to the same plane and used the Create Polygon tool to re-draw the Ngon.. same results I was getting above.

I think this is totally dependent on the locations of the particular vertices in question. As rareseu mentioned, he's seen it work both ways and you're apparently getting different results than me, so it just depends on the vert positions. In my particular setup, if I move the two selected vertices anywhere on the Z axis (planar or non-planar Ngon), the Ngon never changes triangulation (dynamically).

EDIT: I just started with a 'fresh' Polygon Object and added points to it, then created an Ngon as above and am getting an entirely new triangulation - a fairly severely non-planar diamond-shaped quad with a triangle on top and bottom...

http://skinprops.com/images/bad-ngon2.jpg


...I think this alone demonstrates an issue with the triangulation code - that's certainly not what you'd expect (BTW, those two selected vertices were already in that location when I used the Create Polygon tool).

JDP
05-25-2008, 05:55 AM
In my particular setup, if I move the two selected vertices anywhere on the Z axis (planar or non-planar Ngon), the Ngon never changes triangulation (dynamically).


This feature is not enabled by default, you activate it by selecting "N-gon Triangulation" in the Tools menu.

Cheers.

vinced
05-25-2008, 07:10 AM
I think MOI is exporting these n-gons in a absolute valid way.

Then if you look at the ngon in cinema without taking the whole object into consideration, you could also say that this is a absolute valid way to triangulate this ngon.

But if you take the whole object(to which this ngon belongs) into consideration, then the triangulation of cinema doesn`t make any sense. You never ever want to have something triangulated like that.(I can`t imagine one single object where this triangulation would fit)

If you think the problem appears because of the way MOI is creating these ngons, I would answer.
Cinema has to triangulate this ngon in a valid way so that Bodypaint can work with it. But actually Cinema triangulates this ngon in a strange way which obviously causes UV-mapping-problems in Bodypaint(and it is absolutely possible to triangulate this ngon in a way to prevent these problems)

The fact that Bodypaint and Cinema are one and the same software leads to the requirement that cinema should perfectly work together with Bodypaint, but it is not doing so.

The way cinema triangulates these ngons leads to UV-polys separated into pieces and devided over the whole uv-plane.

That is clearly an insufficient triangulation-code to me, because there was no need for cinema to do it in that way.

@JDP

Yes it is now also working for me. Thanks. Now I know what this function is for.

@Kai:

It took some time, but now I understand what you wanted to tell me. The dynamic triangulation was actually off(default), so I haven`t changed the triangulation while moving these points. I`ve just moved the points (see example in MOI-forum) to help identifying the problem(to make it easier recognizable). So the whole case hasn`t anything to do with the dynamic triangulation of cinema.


Here i have attached an image which shows the problems. I haven`t changed anything, only running the Bodypaint wizard with cube-mapping.



uvproblems.jpg (http://forums.cgsociety.org/attachment.php?attachmentid=&stc=1)



Greetings

Dirk

Keith Young
05-25-2008, 01:13 PM
This feature is not enabled by default, you activate it by selecting "N-gon Triangulation" in the Tools menu.

Cheers.

Thanks.. I knew I'd seen it doing that before, but didn't realize there was an option to enable/disable it.

Keith Young
06-11-2008, 07:09 PM
... I think this is totally dependent on the locations of the particular vertices in question. As rareseu mentioned, he's seen it work both ways and you're apparently getting different results than me, so it just depends on the vert positions. ...

...Just being anal here, but I see that I was implying that the problem was likely dependent on the wolrd-space position of the vertices... the issue is more likely due moreso (specifically to this issue) to the order of the vertices in the mesh vertex list (ie. the order they get processed by the internal triangulator).

The triangulator does a nice job at avoiding Concave Ngons, but doesn't appear to bother looking for the best 'planar' solution that is also Convex.

CGTalk Moderation
06-11-2008, 07:09 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.