GitHub – create3000/x_ite:X_ITE X3D 浏览器,查看和作 HTML 中的 X3D、VRML、glTF 等 3D 源。
| Name | ||
|---|---|---|
|
|
5 months ago
|
|
|
|
3 months ago
|
|
|
|
last month
|
|
|
|
3 days ago
|
|
|
|
3 days ago
|
|
|
|
last year
|
|
|
|
3 days ago
|
|
|
|
last year
|
|
|
|
last month
|
|
|
|
3 months ago
|
|
|
|
6 months ago
|
|
|
|
3 days ago
|
|
|
|
5 months ago
|
|
|
|
3 days ago
|
|
|
|
2 months ago
|
|
|
|
4 months ago
|
|
存储库文件导航
X_ITEX3D 浏览器
X_ITE是一个完全用 JavaScript 编写的综合性 3D 库,并使用 WebGL 进行 3D 渲染。作者可以在 HTML5 页面中在线发布 X3D、VRML、glTF 和其他 3D 文件格式,这些X_ITE无需事先安装插件即可与 Web 浏览器配合使用。由于 X3D 向后兼容,因此 X_ITE 也可以用作 VRML 查看器。
🚀 欲了解更多信息和实时预览,请访问我们的主页。
X_ITE需要您的支持。如果您成为 Patreon,我们可以更好地改进X_ITE,或者只是订阅以接收最新消息。
使用 CDN 可以通过缓存更靠近用户的内容、分配流量负载以及提供针对攻击的保护来提高网站性能、可靠性和安全性。
如果要在生产环境中使用 X_ITE,则应使用固定版本的 X_ITE。您可以在 npm 上获取所有可用版本的列表。
jsDelivr 是一个开源内容交付网络 (CDN),以其免费访问、快速的性能和可靠的服务而闻名。
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@12.1.2/dist/x_ite.min.js"></script>
<!-- or as ES module for use in scripts -->
<script type="module">
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@12.1.2/dist/x_ite.min.mjs";
</script>
信息:不再需要包含 CSS 文件。
要安装,请使用以下命令:
$ npm install x_ite
也许您现在很好奇 如何将X_ITE与 Electron 一起使用?
也可以尝试 x_ite-node,一个纯Node.js版本,不依赖 Electron 或任何浏览器。仅适用于读取 3D 文件、分析、处理和生成 X3D。
$ npm install x_ite-node
此脚本在 HTML 页面中初始化 X3D 画布,将其配置为包含具有默认材质属性的场景、相机和几何立方体。然后,它会对场景中立方体的旋转进行动画处理,确保摄像机捕捉动态动作。
<script defer src="https://cdn.jsdelivr.net/npm/x_ite@12.1.2/dist/x_ite.min.js"></script>
<x3d-canvas update="auto" contentScale="auto">
<X3D profile='Interchange' version='4.0'>
<head>
<unit category='angle' name='degree' conversionFactor='0.017453292519943295'></unit>
</head>
<Scene>
<Viewpoint
description='Initial View'
position='2.869677 3.854335 8.769781'
orientation='-0.7765887 0.6177187 0.1238285 28.9476440862198'></Viewpoint>
<Transform DEF='Box'
rotation='0 1 0 0'>
<Shape>
<Appearance>
<Material></Material>
</Appearance>
<Box></Box>
</Shape>
</Transform>
<TimeSensor DEF='Timer'
cycleInterval='10'
loop='true'></TimeSensor>
<OrientationInterpolator DEF='Rotor'
key='0, 0.25, 0.5, 0.75, 1'
keyValue='0 1 0 0, 0 1 0 90, 0 1 0 180, 0 1 0 270, 0 1 0 0'></OrientationInterpolator>
<ROUTE fromNode='Timer' fromField='fraction_changed' toNode='Rotor' toField='set_fraction'></ROUTE>
<ROUTE fromNode='Rotor' fromField='value_changed' toNode='Box' toField='set_rotation'></ROUTE>
</Scene>
</X3D>
</x3d-canvas>
也可以使用纯 JavaScript 创建相同的场景:
<script type="module">
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@12.1.2/dist/x_ite.min.mjs";
const
canvas = document .createElement ("x3d-canvas"), // Or get an already inserted <x3d-canvas> element.
browser = canvas .browser, // Get X3DBrowser reference.
scene = await browser .createScene (browser .getProfile ("Interchange"), browser .getComponent ("Interpolation", 1));
// Append <x3d-canvas> element to body:
document .body .appendChild (canvas);
// Change Browser Options (this could also be done by setting the attributes of the canvas):
browser .setBrowserOption ("AutoUpdate", true); // Disable animations if <x3d-canvas> is not visible.
browser .setBrowserOption ("ContentScale", -1); // Increase resolution for HiDPI displays.
// Create Viewpoint:
const viewpointNode = scene .createNode ("Viewpoint");
viewpointNode .set_bind = true; // Bind the viewpoint.
viewpointNode .description = "Initial View"; // Appears now in the context menu.
viewpointNode .position = new X3D .SFVec3f (2.869677, 3.854335, 8.769781);
viewpointNode .orientation = new X3D .SFRotation (-0.7765887, 0.6177187, 0.1238285, 0.5052317);
scene .rootNodes .push (viewpointNode);
// Create Box:
const
transformNode = scene .createNode ("Transform"),
shapeNode = scene .createNode ("Shape"),
appearanceNode = scene .createNode ("Appearance"),
materialNode = scene .createNode ("Material"),
boxNode = scene .createNode ("Box");
appearanceNode .material = materialNode;
shapeNode .appearance = appearanceNode;
shapeNode .geometry = boxNode;
transformNode .children .push (shapeNode);
scene .rootNodes .push (transformNode);
// Give the node a name if you like.
scene .addNamedNode ("Box", transformNode);
// Create animation:
const
timeSensorNode = scene .createNode ("TimeSensor"),
interpolatorNode = scene .createNode ("OrientationInterpolator");
timeSensorNode .cycleInterval = 10;
timeSensorNode .loop = true;
for (let i = 0; i < 5; ++ i)
{
interpolatorNode .key [i] = i / 4;
interpolatorNode .keyValue [i] = new X3D .SFRotation (0, 1, 0, Math .PI / 2 * i);
}
scene .rootNodes .push (timeSensorNode, interpolatorNode);
// Add routes:
scene .addRoute (timeSensorNode, "fraction_changed", interpolatorNode, "set_fraction");
scene .addRoute (interpolatorNode, "value_changed", transformNode, "set_rotation");
// Show scene.
await browser .replaceWorld (scene);
</script>
在访问外部浏览器中阅读更多内容。
随时欢迎贡献。没有特殊的形式可以做到这一点。一个好主意是分叉 X_ITE 存储库并创建一个与分支不同的分支,进行更改,然后发出拉取请求。development
有关更多信息,请参阅贡献。
X_ITE是免费软件,并根据 MIT 许可证获得许可。
2. 分享目的仅供大家学习和交流,请不要用于商业用途!
3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员!
8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载
声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性
GLB下载网 - GLB/GLTF模型与格式资源免费下载,支持在线浏览与转换 » X_ITE X3D 浏览器,以 HTML 格式查看和作 X3D、VRML、glTF 和其他 3D 源。
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载要提取码
- 分享过期和重复下载怎么办
- 模型和平台不兼容怎么办