3D Object Loader

Hexstatic's picture

Hi

Im having trouble getting a clean object into quartz from maya. My objects always seem to have weird artifacts and when in wireframe polygon mode there is a lot of triangulation.

Any ideas what is the best way to get an object with an outline wireframe as it appears in Maya?

Cheers

Stuart

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: 3D Object Loader

What format is your 3D file in?

Hexstatic's picture
Re: 3D Object Loader

we are trying .fbx, obj, dxf all of which give the same triangulated wireframe. Im coming to the conclusion that Quartz will triangulate any object.

gtoledo3's picture
Re: 3D Object Loader

Hmm. Maybe you should try the remesh patch and see if that makes a difference- also, try turning simplify off.

Cybero's kind of pointing to the fact it could be differences with the way different file types end up rendering. You might want to see if there is a difference between the maya obj and fbx export.

When they are in a Lighting patch, or without wireframe on (I guess you're using GL Tools Polygon Mode?), do they look normal?

gtoledo3's picture
Re: 3D Object Loader

What do you mean by triangulate? You're probably using polygon mode, which is going to show the connecting piece of wireframe (like, put a Sprite in a polygon mode to see what I mean).

cybero's picture
Re: 3D Object Loader

Not only will Quartz use triangulation to recreate 3D objects, like two right angle triangles [can] equals a square, etc, as far as I'm aware, Maya will always triangulate polygons by tessellation.

If you are lacking some edges, you have to create them explicitly and turn them 'soft'. Normals> Soften Edge/Harden Edge options. [Polygon tab].[2011 model].

Still, I'm still learning Maya - it's a monster of an application - huge.

Triangulation, it's hugely important in most 3D graphics and 2D modelling too. It is carried out by whichever programs explicit algorithm is employed and that code will do the best it's been designed to do, which often as not still leaves one whole lot to sort for the perfectionists amongst us.

If it were really that push button easy[like the Kodak approach to 3D modelling], why employ dozens of post origination processing assistants in multimedia labs and ateliers?

Come to think of it, a Kodak , all in one, cheap as chips 3D printer doesn't sound so foolish a concept , now I come to think of it.

jd's picture
Re: 3D Object Loader

Hey Hex! I think the actual outputting of the object itself (from Maya) is converting your object to 3 sided polys. I seem to remember the Nurbs of Maya being converted to polys on any output format. Not as pretty, but can get it to another program that way....

hope this helps....

jd

gtoledo3's picture
Re: 3D Object Loader

I'm going to post something that I think will work for you in a few minutes...

gtoledo3's picture
Re: 3D Object Loader

Here you go Stu...

This will render the style of wire frame you're looking for.

In addition, if you make either x or y line weight 0, you'll get a scan line type look.

PreviewAttachmentSize
Square Wireframe.qtz9.13 KB

Hexstatic's picture
Re: 3D Object Loader

This is very cool!

But, It doesnt seem to work with the 3d object loader - 3d object renderer ?

Any ideas?

gtoledo3's picture
Re: 3D Object Loader

Ok...

I looked at this more and it revealed two issues.

1- I got the texture screwed up - I forgot to erase a line, and the byproduct is that the texture is flipped. The new attachment solves that.

2- I believe if your model doesn't have texture mapping for u/v, you will not be able to get the square render effect. Reference the attachment - I made sure the model has normals and could take a texture map and look correct, and it renders with the square wire frame fine (as does anything generated as a K3D plane or parametric solid).

I'm not sure exactly how to process in Maya to get the model to export with normals and/or uv map it correctly. There might be a tool in the Edit Polygon menu that you have to use to create normals first, but I don't think you have to worry about that (?).

This is a tutorial on creating uv's in maya, which I believe to be your answer...

http://cg.tutsplus.com/tutorials/autodesk-maya/how-to-uv-a-character-mod...

PreviewAttachmentSize
Square Wireframe.zip545.99 KB

franz's picture
Re: 3D Object Loader

When modelling polygons in maya, you actually see a quad representation. However, these quads are made of 3 triangles, with one invisible edge in the middle. This edge is "flagged" as hidden.

When you import your model in QC, it doesn't retain the edges flagged as hidden (as it is not a QC feature).

check this discussion (already one year and a half old ... and still no proper solution) http://kineme.net/Release/Beta/KnMGLTOOLspolygonmodeoffset

If reading the edgeFlag from a FBX file is still possible, i would be willing to pay for this feature ( smokris .... ?)

So far, one workaround is to manually select the edges you want in your 3d package, extract them and convert as polys. The drawback is that you have at least 3 times the vertex count, and you cant change the line width anymore.

The other workaround - which i'm using- is to make a script (MEL or MAXSCRIPT) to export all your edges as line coordinates in a Plist file, then use KnM Line structure to render the wireframe. Not good for large models tho', and you loose all the deformers.

The real problem, imho, it that either the standard Mesh port, or the KnM3D mesh port, are both closed and un-documented ports. So we can't do anything by ourselves, apart from begging the developpers. (because apparently, even money won't help).

gtoledo3's picture
Re: 3D Object Loader

For the reasons you hit on, my guess is that the GLSL shader I posted above will perform much quicker than pre-rendering the model in a wireframe or using a polygon mode, fps wise. Line width isn't set, and it can also be made to look like the wireframe is way more dense than it would be otherwise by increasing the "pseudo polycount" parameter.

I'm sure it works for your scenario, or you wouldn't be doing it, but the line workaround makes me cringe - I've converted models to pure x/y/z structure and loaded from file many a time (and also have used QC to convert many a DAE file to structure), and you're right... the readback/load time can be truly abysmal for non-trivial models. You can't "do anything" with it (deformers), and lines don't respond to lighting or GLSL, can't be textured, and don't get bigger or smaller as you move them back and forth in Z. That said, your visual results speak for themselves... always very cool.

I think it's unfortunate that Mesh Port (and Interaction and Shadows for that matter), aren't documented, but I kinda stand by Kineme keeping K3D mesh port undocumented, since they are a private company, it's a bread and butter product, and substantial changed can be made from release to release without them having to worry about breaking anyone else's related patches. Also, it must be weird for smokris to be put in the position of being main developer for K3D now, since cwright can't work on it (maybe not, just my take). 'Tis life. It's funny how much time has passed, and the explode force (and my sample comp in the dmg), still aren't even official release ;-)!

IMO, besides the lore of skeletal animation/kinematics, I would love to see structure deformers for all of the deformers, to match the structure renderer, and I would also like to see some other things:

-In pixelshox, there's a setting for "squeeze" on the deformer that does twist stuff. A gravity warp can do similar stuff, but it's a little different.

-There was a cool "fragment" effect, which is sort of like explode (which was also available), except that all faces get pushed out evenly.

-There was a liquify effect that makes an object look like it "melts" onto a flat surface.

The object in all of these pics was a volleyball shape originally.

I guess it's also worth noting that there was a 2 way object morph processor patch as well, which still doesn't exist with the Apple mesh tools.

PreviewAttachmentSize
squeeze.jpg
squeeze.jpg187.54 KB
fragment.jpg
fragment.jpg256.01 KB
liquify.jpg
liquify.jpg198.63 KB