Dynamic 3DObject use in ARKit-SceneKit - ios

I want to download the 3D Object-dae(collada) file from server and want to display on surface dynamically so can please share how can I achieve this in ARKit via SceneKit or else?

You can check this link: https://the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/ it is old post but I don't think something is changed since that
According to this (see the Discussion section): https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension?language=objc
dae is not supported at runtime (ModelIO).
Additionally I'm working on a library called AssetKit (In Progress) and it will full support COLLADA and glTF, it is too early to say that but after initial release, you will be able to load dae files dynamically. It is written with C99 but I'll optimize it for Swift (by writing wrappers or integration with SceneKit...). Since it is still in progress I suggest that follow the first link

Related

Load glTF model into RealityKit scene?

I'd like to load a glTF file generated by another program into RealityKit. I get the impression that the only way to load models into RealityKit is via USD or Reality files.
Anyone know a way to get some other model into RealityKit? Not necessarily as a file -- I'd be happy to be able to generate a MeshResource and array of Materials myself and load them in that way.
Reality Converter
Apple discussed this in the WWDC20 video "The artist’s AR toolkit".(link)
They show how to convert FBX, OBJ, USD and GLTF files to USDZs for use in Reality Composer.
Reality Converter is still in beta and needs to be downloaded from the Apple Developer website. I used it and it is quite nice.
There is also other tools you can use on the command line if this is more your thing. At WWDC 2019, Apple announced the USDZ Tools or also called USD Python Tools.
USDZ Tools is a pre-compiled Python library containing binaries of Pixar’s USD library for macOS. This is the link. You will need to download and install the library.
I would give a try to the Reality Converter first. I think it is here to stay since probably Apple has no intention to add support for glTF files in Reality Composer in the future, since they love USBZ!
I ended up using GLTFKit, an open source library by Warren Moore. It does exactly what I want -- lets me load a glTF file into SceneKit/RealityKit.
https://github.com/warrenm/GLTFKit
Alas, as you said, at the moment the only way to load your .gltf model in RealityKit scene – is firstly to convert it into .usdz model via Xcode command line tools. Also in RealityKit you can use .reality format (use it for a much faster uploading time) and .rcproject format that can be exported from Reality Composer app. These two file formats allow you store not only PBR shaders and animation but also a dynamics.
Please, read this post for further details.

Take a screenshot using Javascript without libraries

I wanna build an electron project that will be used to take screenshots and save them. But the main problem is that I don't know how to do this using javascript. I have found a couple of answers but they all included some libraries (mostly html2canvas). So could you give the working code to take screenshots using javascript with no library?
here's how to draw dom into a canvas.
After drawing it on canvas,you can download it by creating canvas's URL.

Use FBX file with 3D model in iOS native app

I have a requirement to display an interactive 3D model (the client supplies few FBX files) in one of the screens in a native Objective-C/Swift app.
I know that there's a possibility to work with Unity/Cocos3D but then the entire app will have to be Unity/Cocos3D based. In my case the app has to be native and only one screen (one of the tabs in the tab bar controller) should integrate the 3D model that the user can move/rotate etc.
Thanks.
The FBX SDK is available on iOS and I wrote a little tutorial to demo how to use it here. However, the FBX SDK does contain a viewport/canvas for displaying FBX file on any OS. For displaying FBX you would need to create your own view. There is couple of solutions you can use here:
without programming, you can use the 'FBX Review'. This tools is free and designed to display FBX, DAE, OBJ, ... files
you can implement your own viewport/view such as an obj view like I did here, but it would probably need to be rewritten. I wrote it overnight for a hack, so it needs to be optimized.
you use the iOS SceneKit library which would be a better approach than implementing your own view.
If you go with option 3 above, you can use Unity to export a Collada (.dae) file for importing into SceneKit thru the collada exporter. You can buy the exporter on the Unity Asset Store directly; there's one for Unity 5.x and one for Unity 2017.

How to edit and load tile maps in Swift? [duplicate]

Is there a (preferably easy) way to load a .tmx file in iOS 7's Sprite Kit? If not, are there any alternatives?
you should use JSTileMap that is designed to work with Sprite Kit
add JSTileMap files to your project
add libz.dylib to the linked frameworks and libraries section of your project
import JSTileMap.h
and load a map with:
JSTileMap *tiledMap = [JSTileMap mapNamed:#"mapFileName.tmx"];
if (tiledMap) [mySKNode addChild:tiledMap];
Here is the source: https://github.com/slycrel/JSTileMap
Good Luck!!
Check out TilemapKit for Sprite Kit. Unlike other solutions it loads and renders all (!) map types and variations supported by Tiled, including staggered iso and hex maps!
TilemapKit is properly engineered like a OOP framework should be, and exposes all data that is stored in the TMX file. In other words it's definitely not just a single class that got everything crammed into it.
Tile picking (point to coord, coord to point conversion) for all map types/variations is built-in. More awesome features on the way, review the roadmap and check out the Class Reference.
TilemapKit is also tested to be fully compatible with Swift and Mac apps, too.
Visit the TilemapKit forum if you have any questions or requests. I'm also posting frequent development reports so you can check what's coming up next.
Disclaimer: If it isn't obvious by now, I'm one of the TilemapKit developers. :)
This is the best I have found. I am not sure if the do-it-yourself method would work this instance as I haven't tried implementing it yet.
http://gamedev.tutsplus.com/tutorials/implementation/parsing-tiled-tmx-format-maps-in-your-own-game-engine/

Load a .tmx (Tiled Map) in Sprite Kit?

Is there a (preferably easy) way to load a .tmx file in iOS 7's Sprite Kit? If not, are there any alternatives?
you should use JSTileMap that is designed to work with Sprite Kit
add JSTileMap files to your project
add libz.dylib to the linked frameworks and libraries section of your project
import JSTileMap.h
and load a map with:
JSTileMap *tiledMap = [JSTileMap mapNamed:#"mapFileName.tmx"];
if (tiledMap) [mySKNode addChild:tiledMap];
Here is the source: https://github.com/slycrel/JSTileMap
Good Luck!!
Check out TilemapKit for Sprite Kit. Unlike other solutions it loads and renders all (!) map types and variations supported by Tiled, including staggered iso and hex maps!
TilemapKit is properly engineered like a OOP framework should be, and exposes all data that is stored in the TMX file. In other words it's definitely not just a single class that got everything crammed into it.
Tile picking (point to coord, coord to point conversion) for all map types/variations is built-in. More awesome features on the way, review the roadmap and check out the Class Reference.
TilemapKit is also tested to be fully compatible with Swift and Mac apps, too.
Visit the TilemapKit forum if you have any questions or requests. I'm also posting frequent development reports so you can check what's coming up next.
Disclaimer: If it isn't obvious by now, I'm one of the TilemapKit developers. :)
This is the best I have found. I am not sure if the do-it-yourself method would work this instance as I haven't tried implementing it yet.
http://gamedev.tutsplus.com/tutorials/implementation/parsing-tiled-tmx-format-maps-in-your-own-game-engine/

Resources