シーン内にテキストエンティティを配置しようとしています。 dynamic-body
は他の要素(球、立方体など)では動作しますが、a-text
では動作しません。ここで'a-text-physics'は 'a-text'と併用できますか?
は私のグリッチです:
https://glitch.com/edit/#!/ruby-stork
シーン内にテキストエンティティを配置しようとしています。 dynamic-body
は他の要素(球、立方体など)では動作しますが、a-text
では動作しません。ここで'a-text-physics'は 'a-text'と併用できますか?
は私のグリッチです:
https://glitch.com/edit/#!/ruby-stork
dynamic-body
自動形状検出がテキストを処理しません。代わりに手動で物理ボディ形状を適用することができます。
<!DOCTYPE html>
<html>
<head>
<title>The text shall fall. - A-Frame</title>
<meta name="description" content="The text shall fall.">
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v2.1.0/dist/aframe-physics-system.min.js"></script>
<script>
window.onload =() => {
const text = document.querySelector('a-text')
// Cannon boxes use 'halfExtents', side length/2
const shape = new CANNON.Box(new CANNON.Vec3(0.5, 0.1, 0.5))
// body may or may not be ready when onload occurs
if (text.body) {
text.body.addShape(shape)
} else {
text.addEventListener('body-loaded',() => text.body.addShape(shape))
}
}
</script>
</head>
<body>
<a-scene>
<!-- "shape:none" to disable auto detection. Required if combining text and geometry in same entity tree -->
<a-text dynamic-body="shape:none" position="-1 2 -3" value="Cylinder falls, this does too." height="1.5" color="#FFC65D" ></a-text>
<a-cylinder dynamic-body position="1 5 -3" rotation="12 0 0" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane static-body position="0 0 -4" rotation="-90 0 0" width="14" height="14" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
</body>
</html>
テキストを薄いボックスに入れてみてください。
<a-entity geometry="primitive: box; depth: 0.01" text="value: HEY" dynamic-body>
'TypeError例外:a.positionがあるundefined' https://glitch.com/edit/#!/sincere-forger –