We used to have an option "Always use Y-Up axis" toggle in Xcode (until Xcode 7 at least, I think).
It's gone in current Xcode 8.2.1, and probably gone since 8.1 or even 8.0. Why? Or is it hiding somewhere else? Any workarounds?
Update: I found a related quote from a WWDC speech, way back in 2014:
The way you add 3D assets to your game is just SceneKit asset
catalogs.
SceneKit asset catalogs are new feature in Xcode 6, SceneKit asset
catalogs are new feature in Xcode 6, and they allow you to organize
and optimize your 3D assets.
The structure of SceneKit asset catalogs is preserved when they are
copied into your target.
Also, they automatically track files that are added to them or removed
from them on disc.
They are really convenient because they can optimize your 3D assets
for you.
For instance, they help with up axis conversion.
SceneKit follows the up axis conversion, which means that the positive
y axis is the one that looks up.
This is a convention that is followed by many other applications and
frameworks, but some exporters do things differently and use a z up
axis convention.
With SceneKit asset catalogs, you don't have to think about that.
We automatically and transparently convert all the animations and
geometries in your scene so that they follow the up axis convention.
Taken from http://asciiwwdc.com/2014/sessions/610
Video at https://developer.apple.com/videos/play/wwdc2014/610/
The above seems to describe the scene kit asset catalog when it was introduced. It doesn't actually answer my question here; why that feature is removed from current Xcode. I can also confirm that no conversion happens behind the scenes. A model exported from Blender is always going to move closer to or away from camera if its Y position is changed. At run-time it is the same.
In Xcode 8, you can Ctrl-click on the .scnasset folder and Open As > SceneKit Catalog. If you make any changes, it will write out a Settings.json file. This may be what you are looking for.
Related
I am writing the app using latest Swift 4.1.2 and Xcode 9.4.1 for iOS 11.4. So I want to use vector images in my app in PDF format. I made the simple app which showing the problem, please, look:
This app only show only one image, but if you rotate the screen, rendering happens and picture becomes beautiful.
So the question is: how to force Xcode render vector images in Main.storyboard without touching the code? So app upload already rendered images?
Go to -> Images.xcassets and select the image. From the attributes inspector, make sure that preserve vector data is checked as following:
I hope it solves your problem.
Xcode 9 changes situation for vector data by allowing you to choose to treat the image as a vector at runtime. This means the image can smoothly scale to arbitrary sizes. The only change you need to make is to tick Preserve Vector Data for the PDF image in the asset catalog.
I started a new Xcode project with the ARKit template and simply replaced the "ship.scn" with my "test.scn" filename asset. The object is about 16.5mm wide and 4.8mm tall. The ship worked fine of course, but my test object that reads "test" does not rotate as I move around it, or scale when I move towards or away from it, yet it does track in one location.
I compared the ship and test attribute panels, and I can't find anything that is different about them, except that the ship is textured and my test text is not. What is inherently special about scn objects that would make them behave correctly in ARKit besides their size? I've read through the documentation about anchoring, but it seems like I wouldn't have to do this in code if it's already a scn object.
In case anyone wants to test the file I'm using in the ARKit template to see how it's behaving, the file is here: https://ufile.io/ey49t
I’m answering the question because I think it could help others that are making a similar mistake, but it can be closed if it doesn’t make sense.
The problem is that the size was much too large where I could not see scaling or rotation no matter how much I moved around the room. Compare the scaled size in the last attribute panel on the ship model - not its actual size. Then get the size of your own model scaled down enough so that it is actually resonable.
For a tvOS app I am trying to set up the App Icon. First xCode complained about the size and now about the image's alpha.
/var/folders/fc/s3m4kgtn2gs977m4k8x2s2xm0000gn/T/Large-AppIcon-Scratch-4AC4A1D7-D8F5-4D58-8667-A11E4F2DE7DA.xcassets:
The last image stack layer with content, "Back", must be a fully
opaque bitmap. The pixel at position (0, 0) has an alpha value of 212.
Are there any easy instructions, tools, or templates which can be used to create a proper App Icon & Top Shelf Image.brandassets ?
(without Photoshop CC!)
Bohemian Coding's Sketch is a great tool to use. If you don't want to spend $100, you can simply use a program like Paint.
For the small icon, each layer should be 659x371.
For the large icon, each layer should be 1977x1113. (3x the size of the small icon).
The bottom layer cannot have any transparency, but the top two need to have transparency.
Also be sure to leave plenty of buffer room around the outside of your icon.
I was dealing with this issue for a while. Finally it dawned on my that Layer 0 can have transparency but Layer 1 cant. With that said, I thought Layer 0 would of been the background and Layer 1 in the foreground, but its the opposite. Layer 0 is the closest to you, if that makes sense.
Instructions can be found in the Apple TV Human Interface Guidelines. There is also a link to download resource templates including templates for both app icons and the topshelf image.
If you provide an opaque back layer for the app icons then your problem should disappear.
You can use any tool of choice, preferably one that is able to import .psd files (the templates are in .psd format). Personally I use Pixelmator. AFAIK GIMP also supports importing .psd files.
I just bought and downloaded Tom's Terrain Tool but I can't find instructions for how to install it. I've looked in the downloaded file - it's a compiled file. I've looked on his website and only find instructions for what to do after it's installed. I've googled around for instructions and can't find them anywhere. In fact, the only file I got with the download is a gzip that extracts into TTT.file. Is that the only thing that was supposed to come with the tool? Why isn't there a readme file with it? Can anyone help me out here? Thanks.
From the installation instructions here:
Created a new terrain
1) Imported a heightmap
2) Calculated the light map
3) Imported all the splatmaps, treemaps, etc. you wish to use into Unity as RGB 24bit textures.
4) If using Unity 2.6, all the textures/maps you intend to use must be set to "readable" in the import settings.
5) If using Unity 3, all the textures/maps must have their Texture Type set to "Advanced" and then checked the "Read/Write
enabled" option.
Once you're installed the Terrain Tools, you will find them in Terrain
=> Tom's Terrain Tools in the Unity editor.
RoyS describes this process in his post here:
Here's the steps I use to get my terrain into Unity.
1 - Generate your L3DT map via the Wizard if you're unfamiliar with
it. Then... File-->Export map-->(select) Heightfield File format -
(pulldown) select "RAW"
-type in a File Name
-check "resize for export"
-1025 size (default) Operations-->Alpha Map-->Alpha Express (png)
The raw is your heightmap and the png is your splatmap. Move those to
your Assets folder.
2 - Make sure "Tom's Terrain Tools" is installed per his instructions.
3 - In Unity Terrain-->Create Terrain Add your 4 textures in Unity as
normal (you can get some nice terrain textures from
http://cgtextures.com ) Terrain-->Import Heightmap RAW
--Bit16
--Windows
Now you should see your heightmap in your first colour chosen. If the
mountains are too high, then go Terrain-->Set Resolution and change
the 600 value. Just change those numbers until you get the desired
height of your mountains and valleys.
Now for the rest of the colour of your terrain.
In Unity, select your png texture in the Project folder and in
Inspector change it to ARGB 32 bit and hit the Apply button. Now you
won't get an error message to change it to 32 bit RBGA as you've just
done it. Now to add the splatmap...
Terrain-->Tom's Terrain Tools-->Splatmap
If you're sand is in your mountain area and your grass under the sea,
then just change the order of your textures until it's right (ie, the
terrain paintbrush textures as if you were painting one from scratch -
the same ones you loaded above).
I am trying to do animations on iPhone using OpenGL ES. I am able to do the animation in Blender 3D software. I can export as a .obj file from Blender to OpenGL and it works on iPhone.
But I am not able to export my animation work from Blender 3D to OpenGL. Can anyone please help me to solve this?
If you have a look at this article by Jeff LaMarche, you'll find a blender script that will output a 3D model to a C header file. There's also a followup article that improves upon the aforementioned script.
After you've run the script, it's as simple as including the header in your source, and passing the array of vertices through your drawing function. Ideally you'd want a method of loading arbitrary model files at runtime, but for prototyping this method is the simplest to implement.
Seeing as you already have a method of importing models (obj) then the above may not apply. However, the advantage of using a blender script is that you can then modify the script to suit your own needs, perhaps also exporting bone information or model keyframes.
Well first off, I wouldn't recommend .obj for this purpose since the obj file format doesn't support animation, only static 3D models. So you'll need to export the animation data as a separate file that you load at the same time as the obj.
Which file format I would recommend depends on what exactly your animations are. I don't remember off the top of my head what file formats Blender supports, but as I recall it does not export Collada files with animation, which would be the most general recommendation. Other options would be md2 for character animations, or 3ds for simple "rigid objects moving around" animations. I think Blender's FBX exporter will work, although that file format may be too complicated for your needs.
That said, and assuming you only need simple rigid object movements, you could use .obj for the 3D model shapes and then write a simple Python script to export a file from Blender that has at the keyframes listed, with the frame, position, and rotation for each keyframe. Then load that data in your code and play back those keyframes on the 3D model.
This is an old question and since then some new iOS frameworks have been released such as GLKit. I recommend relying on them as much as possible when you can, since they take care of many inherent conversions like this, though I haven't researched the specifics. Also, while not on iOS, the new Scene Graph technology for OS X (which will likely arrive on iOS) in the future, take all this quite a bit further and a crafty individual could do some conversions with that tool and then take the output to iOS.
Also have a look at SIO2.
I haven't used recent versions of Blender, but my understanding is that it supports exporting mesh animation as a sequence of .obj files. If you can already display a single .obj in your app, then displaying several of them one after another will achieve what you want.
Now, note that this is not the most efficient form to export this type of animation, since each .obj file will have a lot of duplicated info. If your mesh stays fixed over time (i.e. only the vertices move with the polygon structure, uv coords, etc. all fixed) then you can just import the entire first .obj and from the rest just read the vertex array.
If you wanted to optimize this even more, you could compress the vertex arrays so that you only store the differences from the previous frame of the animation.
Edit: I see that Blender 2.59 has export to COLLADA. According to the Blender manual, you can export object transformations, and you can also export baked animation for rigged objects. The benefit for you in supporting the COLLADA format in your iPhone app is that you are free to switch between animation tools, since most of them export this format.