Using a MTLTexture as the environment map of a SCNScene

Lighting SCN Environment with an MTK texture Using Xcode 13.3.1 on macOS 12.3.1 for iOS 15.4 app. The trick is, the environment lighting requires a cube texture, not a flat image. Create 6 square images for MetalKit cube texture in Xcode Assets folder create Cube Texture Set place textures to their corresponding slots mirror images … Read more

How to create realistic .scn files?

To get some existing models to work with, here is what I did…just the basics that I know. I went to Turbosquid and found a 3D model that would work for me. Make sure it has the OBJ files. Buy and download. Next download Blender. Import the OBJ file you just bought. Export a DAE … Read more

ARKit – Get current position of ARCamera in a scene

Set yourself as the ARSession.delegate. Than you can implement session(_:didUpdate:) which will give you an ARFrame for every frame processed in your session. The frame has an camera property that holds information on the cameras transform, rotation and position. func session(_ session: ARSession, didUpdate frame: ARFrame) { // Do something with the new transform let … Read more

Unable to activate constraint with anchors

dan is right, you need to add sceneView as a subview before you can anchor it. Try something like this: view.addSubview(sceneView) sceneView.anchor(top: self.view.topAnchor, left: self.view.leftAnchor, bottom: self.view.bottomAnchor, right: self.view.rightAnchor, paddingTop: 0, paddingLeft: 0, paddingBottom: 0, paddingRight: 0, width: 0, height: 0)

RealityKit vs SceneKit vs Metal – High-Quality Rendering

Updated: March 11, 2023. TL;DR This post is not only about RealityKit, SceneKit & Metal, but also about related APIs and USD files. RealityKit 2.0 RealityKit is the youngest SDK in Apple family of rendering technologies. This high-level framework was released in 2019. RealityKit is made for AR / VR projects, has simplified settings for … Read more

iOS revert camera projection

Coordinate systems’ correspondence Take into consideration that Vision/CoreML coordinate system doesn’t correspond to ARKit/SceneKit coordinate system. For details look at this post. Rotation’s direction I suppose the problem is not in matrix. It’s in vertices placement. For tracking 2D images you need to place ABCD vertices counter-clockwise (the starting point is A vertex located in … Read more

How to create a SceneKit SCNSkinner object in code?

This three methods may help you to find the solution: SCNNode *hero = [SCNScene sceneNamed:@”Hero”].rootNode; SCNNode *hat = [SCNScene sceneNamed:@”FancyFedora”].rootNode; hat.skinner.skeleton = hero.skinner.skeleton; [Export (“initWithFrame:”)] public UIView (System.Drawing.RectangleF frame) : base (NSObjectFlag.Empty) { // Invoke the init method now. var initWithFrame = new Selector (“initWithFrame:”).Handle; if (IsDirectBinding) Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_RectangleF (this.Handle, initWithFrame, frame); else Handle … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)