View in English

  • Apple 开发者
    • 入门汇总

    探索“入门汇总”

    • 概览
    • 学习
    • Apple Developer Program

    及时了解最新动态

    • 最新动态
    • 开发者你好
    • 平台

    探索“平台”

    • Apple 平台
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    • App Store

    精选

    • 设计
    • 分发
    • 游戏
    • 配件
    • 网页
    • Home
    • CarPlay 车载
    • 技术

    探索“技术”

    • 概览
    • Xcode
    • Swift
    • SwiftUI

    精选

    • 辅助功能
    • App Intents
    • Apple 智能
    • 游戏
    • 机器学习与 AI
    • 安全性
    • Xcode Cloud
    • 社区

    探索“社区”

    • 概览
    • “与 Apple 会面交流”活动
    • 社区主导的活动
    • 开发者论坛
    • 开源

    精选

    • WWDC
    • Swift Student Challenge
    • 开发者故事
    • App Store 大奖
    • Apple 设计大奖
    • Apple Developer Centers
    • 文档

    探索“文档”

    • 文档库
    • 技术概述
    • 示例代码
    • 《人机界面指南》
    • 视频

    发布说明

    • 精选更新
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • Apple tvOS
    • Xcode
    • 下载

    探索“下载”

    • 所有下载
    • 操作系统
    • 应用程序
    • 设计资源

    精选

    • Xcode
    • TestFlight
    • 字体
    • SF Symbols
    • Icon Composer
    • 支持

    探索“支持”

    • 概览
    • 帮助指南
    • 开发者论坛
    • “反馈助理”
    • 联系我们

    精选

    • 《开发者账户帮助》
    • 《App 审核指南》
    • 《App Store Connect 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

    • 活动
    • 新闻
    • 论坛
    • 示例代码
    • 视频
 

视频

打开菜单 关闭菜单
  • 专题
  • 所有视频
  • 关于

更多视频

  • 简介
  • 概要
  • 代码
  • HTML 模型元素入门

    了解模型元素如何将交互式 3D 内容搬上你的网站,这项功能现已登陆 iOS、iPadOS、macOS 和 visionOS。探索用于创建和优化 3D 素材资源的工具。了解模型元素功能,看看各个网页标准如何构筑 3D 网页内容的未来。

    章节

    • 0:00 - Introduction
    • 2:22 - Prepare the USDZ model asset
    • 4:18 - Loading and fallbacks
    • 6:14 - Model background
    • 6:48 - Interactions
    • 8:26 - Transition animation
    • 10:08 - Animation playback
    • 10:52 - AR and spatial
    • 12:29 - Optimize assets for production
    • 14:53 - Next steps

    资源

    • WebKit.org - Theater Ticket Sales immersive website environment demo for Apple Vision Pro
    • The HTML model element in Apple Vision Pro
    • GitHub: model element samples
    • WebKit.org – Report issues to the WebKit open-source project
    • AOUSD – Alliance for OpenUSD
    • w3.org – Model element
    • Submit feedback
      • 高清视频
      • 标清视频

    相关视频

    WWDC26

    • 探索 visionOS 中的沉浸式网站环境
    • 面向 Safari 浏览器 27 的 WebKit 新功能

    WWDC25

    • 空间网页的新功能

    WWDC24

    • USD 和 MaterialX 的新功能
  • 搜索此视频…
    • 4:19 - Load a model

      <!-- Using the src attribute -->
      <model src="mallet.usdz"></model>
      
      <!-- Using a <source> child for MIME type -->
      <model>
          <source src="mallet.usdz" type="model/vnd.usdz+zip">
      </model>
    • 4:39 - Image fallback

      <model id="mallet" src="mallet.usdz">
          <img src="mallet.png"
               alt="Rubber mallet with wooden handle">
      </model>
    • 5:09 - Ready promise

      <model id="mallet" src="mallet.usdz"></model>
      
      <script>
          const model = document.getElementById("mallet");
          model.ready.then(result => {
              // Hide the loading indicator
          }).catch(error => {
              // Loading failed, show fallback
          });
      </script>
    • 5:39 - Polyfill fallback

      <script type="module">
          if (!window.HTMLModelElement) {
              import("model-element-polyfill.js").then(() => {
                  // Polyfill ready to use
              });
          }
      </script>
    • 6:13 - Model background

      <model id="mallet" src="mallet.usdz"></model>
      <style>
          model {
              background-color: #f4f1ec;
          }
      </style>
    • 6:47 - Stage mode

      <model id="mallet"
             src="mallet.usdz"
             stagemode="orbit">
      </model>
    • 7:31 - Custom transforms

      <model id="boot" src="boot.usdz"></model>
      <button id="button-side">Side</button>
      <button id="button-reset">Reset</button>
      
      <script>
          const model = document.getElementById("boot");
          const initialTransform = model.entityTransform;
      
          document.getElementById("button-side")
                  .addEventListener("click", () => {
              const transform = new DOMMatrix();
              transform.rotateSelf(0, 135, 0);
              model.entityTransform = transform;
          });
      
          document.getElementById("button-reset")
                  .addEventListener("click", () => {
              model.entityTransform = initialTransform;
          });
      </script>
    • 8:35 - Transition animation

      <script>
          const model = document.getElementById("boot");
          const duration = 500;
          let currentAngle = 0;
          let animationId = null;
      
          function animateTo(targetAngle) {
              if (animationId) cancelAnimationFrame(animationId);
              const startAngle = currentAngle;
              const startTime = performance.now();
      
              function step(now) {
                  const progress = Math.min((now - startTime) / duration, 1);
                  const ease = 1 - Math.pow(1 - progress, 3);
                  currentAngle = startAngle + (targetAngle - startAngle) * ease;
                  model.entityTransform = new DOMMatrix().rotateSelf(0, currentAngle, 0);
                  if (progress < 1) animationId = requestAnimationFrame(step);
              }
      
              requestAnimationFrame(step);
          }
      
          document.getElementById("button-side").addEventListener("click", () => animateTo(135));
          document.getElementById("button-reset").addEventListener("click", () => animateTo(0));
      </script>
    • 10:07 - Animation playback

      <model id="bottle" src="bottle.usdz"></model>
      <button id="button-play" onclick="play(5)">
          Play
      </button>
      <button id="button-reverse" onclick="play(-5)">
          Reverse
      </button>
      
      <script>
          const model = document.getElementById("bottle");
      
          function play(rate) {
              model.playbackRate = rate;
              model.play();
          }
      </script>
    • 11:06 - AR Quick Look

      <a rel="ar" href="bottle.usdz">
          <model id="boot" src="bottle.usdz"></model>
      </a>
    • 0:00 - Introduction
    • The HTML model element, which brings 3D content to the web as simply as an image and now extends from visionOS to iOS, iPadOS, and macOS — how it compares to the model-viewer library and where it stands as an emerging web standard.

    • 2:22 - Prepare the USDZ model asset
    • Approaches for creating 3D content: scanning with iPhone, converting existing files, authoring in tools like Blender, and generating models from images or text prompts. Why USDZ is the recommended format — it bundles geometry, materials, textures, and animations into a single file.

    • 4:18 - Loading and fallbacks
    • Embed a model with the tag's src attribute or a nested . Use a nested as a fallback for older browsers, await the ready promise to know when the model can be displayed, and load the W3C polyfill so the element works where it isn't supported natively.

    • 6:14 - Model background
    • Set background-color directly on the model element to match the surrounding page. The model renders in its own virtual space and doesn't inherit page styles, and any background is composited as fully opaque.

    • 6:48 - Interactions
    • Add stagemode="orbit" to let visitors rotate the model with automatic spring-back and clipping protection. For custom interactivity, disable stagemode and drive the entityTransform property with a DOMMatrix to snap the model to specific viewing angles from JavaScript.

    • 8:26 - Transition animation
    • Animate between custom orientations by updating entityTransform inside requestAnimationFrame. The pattern captures a starting angle, eases each frame's rotation, and cancels any in-flight animation so successive transitions don't conflict.

    • 10:08 - Animation playback
    • Play animations baked into a USDZ file using the element's play() method and playbackRate property. Positive rates play forward, negative rates reverse, and the magnitude scales speed.

    • 10:52 - AR and spatial
    • Wrap the model in an tag to enable AR Quick Look on iOS and iPadOS. On visionOS the model element renders stereoscopically and can power immersive website environments that place visitors inside a 3D scene.

    • 12:29 - Optimize assets for production
    • Use usdcrush to shrink USDZ files (often by 4x) with no perceived quality loss, and usdrecord to render thumbnails or fallback images from a 3D file. Both ship with macOS as part of the broader USD tool suite.

    • 14:53 - Next steps
    • Generate a 3D model from images or a prompt, add a tag to your site, optimize assets with usdcrush, and join the W3C Immersive Web Community Group to help shape the spec.

Developer Footer

  • 视频
  • WWDC26
  • HTML 模型元素入门
  • 打开菜单 关闭菜单
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    打开菜单 关闭菜单
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    打开菜单 关闭菜单
    • 辅助功能
    • 配件
    • Apple 智能
    • App 扩展
    • App Store
    • 音频与视频 (英文)
    • 增强现实
    • 设计
    • 分发
    • 教育
    • 字体 (英文)
    • 游戏
    • 健康与健身
    • App 内购买项目
    • 本地化
    • 地图与位置
    • 机器学习与 AI
    • 开源资源 (英文)
    • 安全性
    • Safari 浏览器与网页 (英文)
    打开菜单 关闭菜单
    • 完整文档 (英文)
    • 部分主题文档 (简体中文)
    • 教程
    • 下载
    • 论坛 (英文)
    • 视频
    打开菜单 关闭菜单
    • 支持文档
    • 联系我们
    • 错误报告
    • 系统状态 (英文)
    打开菜单 关闭菜单
    • Apple 开发者
    • App Store Connect
    • 证书、标识符和描述文件 (英文)
    • 反馈助理
    打开菜单 关闭菜单
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program (英文)
    • Mini Apps Partner Program
    • News Partner Program (英文)
    • Video Partner Program (英文)
    • 安全赏金计划 (英文)
    • Security Research Device Program (英文)
    打开菜单 关闭菜单
    • 与 Apple 会面交流
    • Apple Developer Center
    • App Store 大奖 (英文)
    • Apple 设计大奖
    • Apple Developer Academies (英文)
    • WWDC
    阅读最近新闻。
    获取 Apple Developer App。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则