scnmaterial

Hide area of an SCNMaterial

懵懂的女人 提交于 2021-01-28 09:19:53
问题 I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it. I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move when the camera moves, only the radius shape will move. What kind of technique could I use for this ? ArCore by Google does this perfectly. Actual rendering: Desired Rendering: ARCore example: (click to see GIF) Thank you! 回答1: I would use a shader

Add UIView (from xib) with transparency to SceneKit

孤街浪徒 提交于 2019-12-10 13:19:50
问题 I'm trying to load a UIView into SceneKit with a translucent background, but currently, it just fades to white as I decrease the opacity. I have a very simple UIView layout in a .xib file that I want to load into SceneKit. So far I can display the UIView in the SCNMaterial, change any text fields, images, etc inside the view without a problem. However, I cannot let it have transparency. If I change the alpha of the view it just fades to white. most of the code is the below: if let cardView =

Render a 3D model (hair) with semi-transparent texture in SceneKit?

微笑、不失礼 提交于 2019-12-10 00:19:40
问题 I'm trying to render a 3D model in SceneKit but it looks incorrect. For example this model (it's an SCN file with texture and you can reproduce it in your Xcode): In Xcode Scene Editor it is rendered like this: Transparency -> Mode -> Dual Layer Double Sided = true If I turn off the "Write depth" option, it will look like this: But there are also some issues because it I see only "the lowest layer" of haircut. I think this should be possible. How to do it right? 回答1: The reason that in your

Render a 3D model (hair) with semi-transparent texture in SceneKit?

和自甴很熟 提交于 2019-12-04 22:52:43
I'm trying to render a 3D model in SceneKit but it looks incorrect. For example this model (it's an SCN file with texture and you can reproduce it in your Xcode): In Xcode Scene Editor it is rendered like this: Transparency -> Mode -> Dual Layer Double Sided = true If I turn off the "Write depth" option, it will look like this: But there are also some issues because it I see only "the lowest layer" of haircut. I think this should be possible. How to do it right? The reason that in your 3D model some strands of hair popped out when viewed from different angles is quite usual for SceneKit: your

How do I use a web mercator projection map for SCNMaterial on an SCNShere geometry?

时光毁灭记忆、已成空白 提交于 2019-12-01 11:23:01
I have a simple globe view in my app. Previously we were using WhirlyGlobe, but have opted to use SceneKit instead. Everything works great and we are happy with it EXCEPT we used map tiles in Whirly Globe and the do not work (as far as I can tell) in SceneKit. We want to use that map (tiled, split or as one file) on an SCNSphere geometry. I copied the satellite map that Apple uses in their documentation and it looks right, but is not the map we need. Our map is in web/sphere mercator projection and it looks bad in SceneKit on my sphere. I do not* know what the 2x1 projection Apple is using is

How do I use a web mercator projection map for SCNMaterial on an SCNShere geometry?

帅比萌擦擦* 提交于 2019-12-01 09:45:21
问题 I have a simple globe view in my app. Previously we were using WhirlyGlobe, but have opted to use SceneKit instead. Everything works great and we are happy with it EXCEPT we used map tiles in Whirly Globe and the do not work (as far as I can tell) in SceneKit. We want to use that map (tiled, split or as one file) on an SCNSphere geometry. I copied the satellite map that Apple uses in their documentation and it looks right, but is not the map we need. Our map is in web/sphere mercator