Hi! I created manually USDZ with one cube to anchoring on wall (vertical plane)
#usda 1.0
(
defaultPrim = "Root"
metersPerUnit = 1
upAxis = "Y"
)
def Xform "Root" (
assetInfo = {
string name = "Root"
}
kind = "component"
)
{
def Xform "Geom" (
prepend apiSchemas = [ "Preliminary_AnchoringAPI" ]
)
{
# token preliminary:anchoring:type = "plane"
# token preliminary:planeAnchoring:alignment = "vertical"
matrix4d xformOp:transform = (
(0, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0.2, 1) )
def Xform "Group"
{
def Cube "cube_0"
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
uniform bool doubleSided = 1
rel material:binding = </Root/Materials/material_0>
matrix4d xformOp:transform = (
(0.1, 0, 0, 0),
(0, 0.1, 0, 0),
(0, 0, 0.01, 0),
(0, 0, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
}
}
}
It's displayed correct in ARQuickLook
When I add second cube to USD(z)
#usda 1.0
(
defaultPrim = "Root"
metersPerUnit = 1
upAxis = "Y"
)
def Xform "Root" (
assetInfo = {
string name = "Root"
}
kind = "component"
)
{
def Xform "Geom" (
prepend apiSchemas = [ "Preliminary_AnchoringAPI" ]
)
{
# token preliminary:anchoring:type = "plane"
# token preliminary:planeAnchoring:alignment = "vertical"
matrix4d xformOp:transform = (
(0, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0.2, 1) )
def Xform "Group"
{
def Cube "cube_0"
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
uniform bool doubleSided = 1
rel material:binding = </Root/Materials/material_0>
matrix4d xformOp:transform = (
(0.1, 0, 0, 0),
(0, 0.1, 0, 0),
(0, 0, 0.01, 0),
(0, 0, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
def Cube "cube_1"
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
uniform bool doubleSided = 1
rel material:binding = </Root/Materials/material_0>
matrix4d xformOp:transform = (
(0.1, 0, 0, 0),
(0, 0.1, 0, 0),
(0, 0, 0.01, 0),
(0.3, 0, 0, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
}
}
}
ARQuickLook display scene ~ 10 cm from wall, and then scene have more cubes we see increased distance from wall. Here for two cubes
I also tryed recreate scene in Reality Composer on iPhone. Everything ok for one cube, and ok when preview in App(ARKit?) for two cubes, but when export scene in RealityComposer macOS to USDZ we again see wrong distance for two cubes and more.
For tests I use iPhone 13 Pro Max with iOS 16.3.1
Post
Replies
Boosts
Views
Activity
Hi!
Simple scene with two planes - one plane with size 1x1, other with 0.5x0.5 in Xcode 12.5.1.
When I export scene to usdz(usd) in Finder preview I get two planes with size 1x1.
This is bug?
Hi!
When run below code in iOS blank Playground
import UIKit
let contextBig = CGContext(
data: nil,
width: 560,
height: 560,
bitsPerComponent: 8,
bytesPerRow: 2240,
space: CGColorSpace(name: CGColorSpace.sRGB)!,
bitmapInfo: CGImageAlphaInfo.premultipliedFirst.rawValue)
print (contextBig as Any)
Result in console:
Optional(CGContext 0x600003cc0540 (kCGContextTypeBitmap)
CGColorSpace 0x600002ddc300 (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1)
width = 560, height = 560, bpc = 8, bpp = 32, row bytes = 2240
kCGImageAlphaPremultipliedFirst | 0 (default byte order) | kCGImagePixelFormatPacked (default) )
But when change width and height to 561, result in console:
nil
Is there for playground some memory limits or etc?
Xcode - Version 12.3 (12C33)