Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 Graphics & GamesSpatial Computing

WWDC20 · 25 min · Graphics & Games / Spatial Computing

What’s new in USD

Discover proposed schema and structure updates to the Universal Scene Description (USD) standard. Learn how you can use Reality Composer to build AR content with interactive properties like anchoring, physics, behaviors, 3D text, and spatial audio that exports to USDZ. And, discover streamlined workflows that help you bring newly-created objects into your app. If you’re interested to learn more about USDZ as a distribution format, check out "Working with USD.” And for more on creating AR content with Reality Composer, watch “The Artist’s AR Toolkit." We’d love to hear feedback about the preliminary schemas. After you watch this session, come join us on the Developer Forums and share your thoughts.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 12 snippets

USD scene structure javascript · at 11:44 ↗
def Xform "Root" (
    kind = "sceneLibrary"
)
{
    def Cube "MyCubeScene" (
        sceneName = "My Cube Scene"
    )
    { 
        ... 
    }

    over Sphere "MySphereScene" (
        sceneName = "My Sphere Scene"
    )
    { 
        ... 
    }
}
Adding anchoring to USD javascript · at 13:30 ↗
def Cube "ImageAnchoredCube" (
    prepend apiSchemas = [ "Preliminary_AnchoringAPI" ]
)
{
    uniform token preliminary:anchoring:type = "image"
    rel preliminary:imageAnchoring:referenceImage = <ImageReference>

    def Preliminary_ReferenceImage "ImageReference"
    {
        uniform asset image = @image.png@
        uniform double physicalWidth = 12
    }

    ...
}
Defining a behavior javascript · at 15:11 ↗
def Preliminary_Behavior "TapAndBounce"
{
    rel triggers = [ <Tap> ]
    rel actions = [ <Bounce> ]

    def Preliminary_Trigger "Tap"
    {
        uniform token info:id = "tap"
        rel affectedObjects = [ </Cube> ]
    }

    def Preliminary_Action "Bounce"
    {
        uniform token info:id = "emphasize" 
        uniform token motionType = "bounce"
        rel affectedObjects = [ </Cube> ]
    }

    ...
}
Compound behavior swift · at 16:22 ↗
def Preliminary_Behavior "TapOrGetCloseAndBounceJiggleAndFlip"
{
    rel triggers = [ <Tap>, <Proximity> ]
    rel actions = [ <Bounce>, <Jiggle>, <Flip> ]

    ...
}
Defining physics swift · at 17:19 ↗
def Sphere "WoodenBall" (
    prepend apiSchemas = [ "Preliminary_PhysicsColliderAPI",
                           "Preliminary_PhysicsRigidBodyAPI" ]
)
{
    rel preliminary:physics:collider:convexShape = </WoodenBall>
    double preliminary:physics:rigidBody:mass = 10.0
}
Applying a wood material for physics javascript · at 18:15 ↗
def Material "Wood" (
    prepend apiSchemas = ["Preliminary_PhysicsMaterialAPI"]
)
{
    double preliminary:physics:material:restitution = 0.603
    double preliminary:physics:material:friction:static = 0.375
    double preliminary:physics:material:friction:dynamic = 0.375
}

def Sphere "WoodenBall" (
    prepend apiSchemas = [ "Preliminary_PhysicsColliderAPI",
                           "Preliminary_PhysicsRigidBodyAPI" ]
)
{
    rel preliminary:physics:collider:convexShape = </WoodenBall>
    double preliminary:physics:rigidBody:mass = 10.0
    rel material:binding = </Wood>
}
Defining a ground plane javascript · at 18:40 ↗
def Xform "MyScene" (
    prepend apiSchemas = ["Preliminary_PhysicsColliderAPI"]
)
{
    def Preliminary_InfiniteColliderPlane "groundPlane" (
        customData = {
            bool preliminary_isSceneGroundPlane = 1
        }
    ) {
        point3d position = (0, 0, -2)
        vector3d normal = (0, 1, 0)
        rel preliminary:physics:collider:convexShape = </MyScene/groundPlane>
    }
    rel material:binding = </Wood>
}
Adding gravity swift · at 19:08 ↗
def Preliminary_PhysicsGravitationalForce "MoonsGravity"
{
    vector3d physics:gravitationalForce:acceleration = (0, -1.625, 0)
}
Defining spatial audio javascript · at 20:28 ↗
def SpatialAudio "HorseNeigh"
{
    uniform asset filePath        = @Horse.m4a@
    uniform token auralMode       = "spatial"
    uniform timeCode startTime    =  65.0
    uniform double mediaOffset    =  0.33333333333
    double3 xformOp:translate = (0, 0.5, 0.1)
    uniform token[] xformOpOrder = ["xformOp:translate"]
}
3D text javascript · at 21:45 ↗
def Preliminary_Text "heading"
{
    string content = "#WWDC20"
    string[] font = [ "Helvetica", "Arial" ]
    token wrapMode = "singleLine"
    token horizontalAlignment = "center"
    token verticalAlignment = "baseline"
}
Playback metadata javascript · at 22:46 ↗
#usda 1.0
(
    endTimeCode = 300
    startTimeCode = 1
    timeCodesPerSecond = 30
    playbackMode = "loop"
    autoPlay = false
)

def Xform “AnimatedCube"
{
    ...
}
Scene understanding metadata swift · at 23:08 ↗
def Xform "Root" (
    kind = "sceneLibrary"
)
{
    def Xform "MyScene" (
        sceneName = "My Scene"
        preliminary_collidesWithEnvironment = true
    )
    {
        def Xform "DigitalBug"
        {
            ...
        }
    }
}