Viewing 3d Models on iOS

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
3d Models on iOS... transparency?

I'm an "amateur" graphic designer and I work at a company that manufactures energy drinks and energy shots. I've been trying to find a solution to supply our sales team with 3d models of all our products, which they can show customers via their iphones/ipads.

I've tried out a number of 3d viewers for iOS, and was never able to get close to a solution until recently. Specifically, I have been looking for an app which can display .OBJ files consisting of several surfaces, some of which use image textures.

I found one that is looking very promising, ATView-3D-OBJ, but I am having issues dealing with surfaces that have transparency:

Screenshot in ATView-3D-OBJ


Render from Maya


If I try using a a surface without an image texture, with a reduced opacity, it just displays as a solid surface in the app.

I'm not sure if the app simply doesn't support transparency, or if I am just using the wrong kind of materials, or using the wrong settings, etc.

If anyone could help me out it would be greatly appreciated!

Here is what my .MTL looks like:

newmtl lambert2SG
illum 4
Kd 1.00 1.00 1.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
Ni 1.00
Ks 0.50 0.50 0.50
Ns 18.00
newmtl lambert3SG
illum 4
Kd 0.00 0.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
map_Kd 4118_6hourpower_4-pack_2ozsleeve_extrastrengthgrape.png
Ni 1.00
Ks 0.00 0.00 0.00
Ns 18.00
newmtl phong3SG
illum 4
Kd 1.00 1.00 1.00
Ka 0.00 0.00 0.00
Tf 0.14 0.14 0.14
Ni 1.00
Ks 0.50 0.50 0.50
Ns 18.00
newmtl phong4SG
illum 4
Kd 0.00 0.00 0.00
Ka 0.00 0.00 0.00
Tf 1.00 1.00 1.00
map_Kd 4150_value4-pack_clearband.png
Ni 1.00
Ks 0.50 0.50 0.50
Ns 18.00


The transparent "shrink band" has the transparency in the image itself (a .PNG image)

Last edited by altoiddealer : 10 October 2012 at 06:01 PM.
 
Old 10 October 2012   #2
There are several kinds of transparency:
- material transparency
- texture transparency

The .mtl file defines material transparency using the 'd' keyword:
d 0.500000 // 50% material transparency

The .mtl file does not know anything about texture transparency. The program
will have to figure this out on its own.

I would just use a simple 3D box to test each type of transparency by itself.
Then you will know for sure.
 
Old 10 October 2012   #3
Originally Posted by Creed: There are several kinds of transparency:
- material transparency
- texture transparency

The .mtl file defines material transparency using the 'd' keyword:
d 0.500000 // 50% material transparency

The .mtl file does not know anything about texture transparency. The program
will have to figure this out on its own.

I would just use a simple 3D box to test each type of transparency by itself.
Then you will know for sure.


Well, I tried setting transparency using "d" and also "Tr", but apparently the program does not seem to acknowledge these parameters... *sigh*

I'm at a loss

Does anyone else know if there is anything else I can try?

Does anyone know another program that I can use to display my 3d models on iPhone and iPad? Must support multiple image textures, and transparency.
 
Old 10 October 2012   #4
If the first picture doesn't have any transparency, then I would say those are z-buffering artifacts,
due to the faces being so close to each other. Double-sided faces can also be troublesome.
Whatever the case, that is not a material/texture problem.

Use 'd' instead of 'Tr'. 'Tr' is inverted alpha (1-alpha). Don't use both at the same time.
You'll just confuse the program.

If you don't care to try my 3D box suggestion, then make all the materials transparent.
You should see something then or not.

Put the line:
d 0.5

after every line that starts with "newmtl".

Last edited by Creed : 10 October 2012 at 04:43 PM.
 
Old 10 October 2012   #5
Originally Posted by Creed: If the first picture doesn't have any transparency, then I would say those are z-buffering artifacts, due to the faces being so close to each other.


I tried exporting the "shrink sleeve" only (without the bottles) but it yielded the same result.


Originally Posted by Creed: Double-sided faces can also be troublesome.


But this might be the issue here, because it is a double-sided surface.


Originally Posted by Creed: Put the line:
d 0.5

after every line that starts with "newmtl".


I just tried this exactly, but still no dice All of my materials still look exactly the same


I'm going to look into the single-surface thing right now, but in the meantime if there's anything else you an think of that I can try, its very much appreciated
 
Old 10 October 2012   #6
Your problem doesn't look like a "transparency issue".

It looks more like a "clipping problem" caused by double-sided faces that aren't oriented properly.

1) Make sure your transparent object is one-sided.

2) Make sure the polygon faces on the object are all oriented in the same direction (outward... towards the viewer)

Hope that helps...
 
Old 10 October 2012   #7
I realized that the issue with the band looking ridiculous was because I had a separate (hidden) layer, which was just a solid shape with transparency. The function "Export All" exported this layer as well even though it was hidden.

So now that I deleted this hidden layer, here is where I am now:



The normals are facing the correct direction as you can tell by the green "bursts", but the program does not seem to like the transparency in the texture.

At this point I tried using the "d 0.5" again to no avail

Last edited by altoiddealer : 10 October 2012 at 06:10 PM.
 
Old 10 October 2012   #8
There is also a PC version of this program, so I downloaded it, and checked it out.

The PC version does do material transparency, but it doesn't do single-texture transparency,
at least with PNG files. It doesn't seem to do multi-texture transparency either.

And there's a bug with loading groups with multi-materials. But, it does say the program
is a beta version from two years ago.

In your .mtl file you have:
map_Kd 4150_value4-pack_clearband.png

map_Kd is for the diffuse map only. If there's any transparency in this file,
it will be ignored. And rightfully, it should be, as it goes against the spec.

With .obj files, to get texture transparency, you must have two files: the diffuse map,
and the opacity map.

Example:
map_Kd myDiffuseMap.png
map_d myOpacityMap.png

If you do that, then you should see more success with wavefront .obj loading programs, if not this one.
 
Old 10 October 2012   #9
Originally Posted by Creed: There is also a PC version of this program, so I downloaded it, and checked it out.


Wow man, thank you for looking so deep into this matter for me. I hadn't thought of trying that myself


Originally Posted by Creed: With .obj files, to get texture transparency, you must have two files: the diffuse map,
and the opacity map.

Example:
map_Kd myDiffuseMap.png
map_d myOpacityMap.png


Hmm so now I'm going to try and figure out how I can create/export an opacity map, and see what happens.


Originally Posted by Creed: If you do that, then you should see more success with wavefront .obj loading programs, if not this one.


I've tried pretty much every app that's out there but unfortunately just haven't been able to find one that can do the job! This one is the closest one yet

Again, many thanks for you help.
 
Old 10 October 2012   #10
There is a Graphics Engine called NinevehGL.

Here's the link: http://nineveh.gl/

It provides easy to use methods to load and display 3D models if you know a bit of iOS programming.

If you trust me maybe you can send me a sample of your OBJ model and I'll try write a demo app to see if it works.

PM me if you like.
__________________
Into digital art.
 
Old 10 October 2012   #11
Originally Posted by chewedon: There is a Graphics Engine called NinevehGL.

Here's the link: http://nineveh.gl/

It provides easy to use methods to load and display 3D models if you know a bit of iOS programming.

If you trust me maybe you can send me a sample of your OBJ model and I'll try write a demo app to see if it works.

PM me if you like.


I'm not ready to give up on ATView-3d just yet. I believe that I do need to figure out how to export the transparency map as a separate file, the problem is that I've been searching all morning without finding the solution

One of the really nice features this app has is its file management. If I zip up my .OBJ and all of the extrernal files (textures, .mtl file), it can open that .zip file and display the model. The app also allows a folder structure, so I can actually separate all the different products into their respective categories (we have at least a hundred different product packouts). So I can have a folder "6 Hour Power" with all the flavors Berry.zip, Grape.zip, Orange.zip, etc., and different folders for our other product lines, Stacker2, Stacker3, Xtra, etc.
 
Old 10 October 2012   #12
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:35 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.