USDZ is binary zip version of Universal Scene Description (USD) format.
Other related format is USDA (USD - Ascii).
usdz_converter that comes with xcode beta can convert OBJ, Alembic ABC and USDA files.
More info on USD:
http://graphics.pixar.com/usd/docs/index.html
https://github.com/PixarAnimationStudios/USD
The second link has a few sample USDA files in extras/usd/tutorials directory.
Here is a minimal USDA file if you are really interested.
#usda 1.0
def Sphere "sphere"
{
}
I tried to find more example USDA files to understand the file format. Unfortunatly there aren't many on the web.
This is probably because the file is supposed to be exported from various 3D applications or created programatically and used by rendering pipeline.
The second link above (on github) also has all tools to create USD files programatically.
If you are interested in building the tools and USD api on mac, I found this useful since the original build instructions don't work well.
https://github.com/vfxpro99/usd-build-club/wiki/USD-on-macOS
The more simple way to create USDZ however is to convert an OBJ files to USDZ using usdz_converter. There are plenty of free OBJ files available on internet (example: turbosquid.com).
I read on these forums many people complaining that OBJ conversion fails for them. I had the same issue, but did some experimentation with OBJ files and I am able to convert them. They are ASCII files and easy to hand-edit.
Some of the things I found during experimentation.
1. The converter does not provide helpful messages when it fails. The messages do not point to problem lines in OBJ file.
2. You can edit the file and try to simplify it to make it work with converter.
This link explains the format: http://paulbourke.net/dataformats/obj/
If you see any line starting with a character other than the following, find out if it is correct. Usually the lines should start with
comment (#), vertex data (v, vt, vn, vp), faces (f), groups (g)
If you see lines starting with something else, try commenting them out with #.
3. Make sure there is at-least one group (g)
4. Make sure there are no extraneous groups other than your main object. I have seen some obj files starting and ending with empty groups (g), and usdz_converter fails on them.
5. I found through experiementation that one unit 1.0 in obj is equivalent to 1 centimeter.
(I am not saying that files that fail have incorrect format. Most likely this first version of usdz_converter is not taking into account the entire OBJ spec. However, simplifying can get you past original conversion process).
Here is a sample cube OBJ file to understand the general structure.
# cube.obj
#
v -0.5 -0.5 -0.5
v -0.5 -0.5 0.5
v -0.5 0.5 -0.5
v -0.5 0.5 0.5
v 0.5 -0.5 -0.5
v 0.5 -0.5 0.5
v 0.5 0.5 -0.5
v 0.5 0.5 0.5
vn 0.0 0.0 1.0
vn 0.0 0.0 -1.0
vn 0.0 1.0 0.0
vn 0.0 -1.0 0.0
vn 1.0 0.0 0.0
vn -1.0 0.0 0.0
vt 0.0 0.0
vt 0.25 0.0
vt 0.5 0.0
vt 0.0 0.25
vt 0.25 0.25
vt 0.5 0.25
vt 0.0 0.5
vt 0.25 0.5
vt 0.5 0.5
vt 0.0 0.75
vt 0.25 0.75
vt 0.5 0.75
g cube
f 1/4/4 5/5/4 6/2/4
f 1/4/4 6/2/4 2/1/4
f 3/5/3 8/3/3 7/6/3
f 3/5/3 4/2/3 8/3/3
f 1/5/2 7/7/2 5/8/2
f 1/5/2 3/8/2 7/7/2
f 2/5/1 6/6/1 8/9/1
f 2/5/1 8/9/1 4/8/1
f 1/7/6 4/11/6 3/10/6
f 1/7/6 2/8/6 4/11/6
f 5/9/5 7/12/5 8/11/5
f 5/9/5 8/11/5 6/8/5
The texture coordinates are based on 6 simple squares define like so:
http://www.trayser.net/assets/usd/cube_color.png
For a more realistic example I created. You can open USDA file in text editor to see the format for yourself.
1. OBJ File, Color Map, Normal Map,
xcrun usdz_converter apple.obj -l -d apple.usdz -color_map appleD.jpg -normal_map appleN.jpg
Note that I used "-l -d" options during conversion and it produced this intermidiate USDA File
I was able to hand-edit the USDA file and insert scaling information at the end to scale the apple to a normal size since the original OBJ was too small.
2. I later used the USDA file and re-ran the converter to produce USDZ File at correct size.
xcrun usdz_converter apple.usda apple.usdz
I downloaded the royalty free apple obj from turbosquid. You can find many royalty free and free models there.
Hope this helps.