- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我使用 SphereGeometry
创建了一个简单的 WebGL 3D 全景应用程序, PerspectiveCamera
和一个 CanvasTexture
.现在,我希望通过在 SphereGeometry
的某些部分添加“热点”来使场景栩栩如生。 .我遇到的问题是了解如何更新各种 DOMElements
以便他们的位置反射(reflect)更新的Camera
位置。
基本上,作为Camera
旋转各种 DOMElements
会相对于相机旋转的方向移入和移出视野。我尝试定位 <div>
absolute
到 <canvas>
和 translating
X
和 Y
使用返回的 PerspectiveCamera
的位置camera.rotation
但它并没有真正起作用;这是我的 JS 和 CSS 实现:
CSS
#TestHotSpot {
/* not sure if using margins is the best method to position hotspot */
margin-top: 50px;
margin-left: 50px;
width: 50px;
height: 50px;
background: red;
position: absolute;
}
JavaScript
/**
CONFIG is my stored object variable; it contains the PerspectiveCamera instance
code is being called inside of my RequestAnimationFrame
**/
config.camera.updateProjectionMatrix();
config.controls.update(delta);
document.getElementById("TestHotSpot").style.transform = "translate("+ config.camera.rotation.x +"px, "+ config.camera.rotation.y +"px)";
Here也是预期效果的一个活生生的例子。
解决此问题的最佳解决方案是什么?我在运行此命令时注意到 DOMElements
只会轻微移动;我还注意到他们并没有真正考虑到 SphereGeometry
的位置。它们被放置(例如,位于 Camera
的“后面”;真的很复杂!
我很乐意为 THREE.js
使用任何插件引擎以及遵循任何教程。非常感谢您提前回复!
最佳答案
然后你就完成了!!
关于javascript - 使用 DOMElements 的 THREE.js SphereGeometry Panorama 热点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31802856/
我尝试使用标准方法通过 CssClass 获取 GWT 元素的大小,但它返回 0; Canvas canvas = Canvas.createIfSupported(); if(can
我是 js 新手,需要使用自定义方法和数据扩展 dom 元素。 对于数据,我使用 html 中内置的数据集属性。对于方法我不知道该怎么做。 是否有众所周知的最佳实践来实现这一目标? 最佳答案 围绕 D
这是我的代码: My Asked text for value 15min'; $dom = new DOMDocument; @$dom->loadHTML($html); $links = $do
我在我的项目中使用 Xerces-c,并且想创建一个 DOMElement 而不必创建一个全新的 DOMDocument。这样的事情可能吗? 最佳答案 我还没有看到方法。 AFAIK DOMDocum
我正在使用 readability从网页中提取 HTML 的代码。如何在页面上显示它? $content = grabArticle($webpage); echo $content; ERROR =
有没有办法检查元素是否可渲染? 例如,我想要一些方法返回 true在 br a div body html等等 但要返回false在 head style script等等 我试过了 if(!el.s
如何获取一个元素的所有属性?就像我下面的例子一样,我一次只能得到一个,我想拉出所有 anchor 标签的属性。 $dom = new DOMDocument(); @$dom->loadHTML(ht
我尝试解析 XML rss 流量。实际上,抛出了一个错误: Catchable fatal error: Object of class DOMElement could not be convert
我有这个 DOMElement。 我有两个问题: 1) 对象值省略是什么意思? 2) 如何从这个 DOMElement 中获取属性? object(DOMElement)#554 (18) {
一个.php #!/usr/bin/php appendChild(new DOMElement("tr")); for($j = 0; $j appe
我正在 Cordova 中创建一个应用程序,并使用 Createjs 来处理我的所有图形。如果我想创建一个表单以便用户可以输入他们的名字 - 我是否只使用文本区域字段(在 DIV 中)并在 DomEl
我在变量中有一个 DOM 元素,例如 ... var a = document.getElementById("hello"); 然后我需要知道a是否会被这个选择器查询捕获 "div>d
我有一个包含行的表格,需要计算出任何行的高度。 var height = $('table').find('tbody > tr').height(); console.log(height); 在我
如何在 DOMNodeList 对象中使用 .getElementsByTagName ?喜欢: procedure TForm1.selecionarClick(Sender: TObject);
我网站上的按钮有 onclick 函数 addNewSetPlanningReskilling()。 但是我无法通过在我的环境中使用变量来获取 DOMelement,但在控制台中我可以。 functi
目前,要在 DOM 中放置绝对元素,我使用: this.myObject.style.left = aValue1 + 'px' ; this.myObject.style.top = aValue2
为什么我在这段代码中回显结果时没有得到任何东西: $result1 = 'Moved TemporarilyMoved TemporarilyThe document has moved here.'
有没有办法只检索通过调用 DOMElement::getElementsByTagName 找到的直接子项?例如,我有一个包含类别元素的 XML 文档。该类别元素具有子类别元素(具有相同的结构),例如
假设我有一个带有 textarea 的简单 HTML 页面,我想将该 textarea 包装在一个 DIV 中。但是,这并不总是在启动/页面加载时发生,因此用户可能会专注于该区域,甚至正在打字。 我可
我有一个 DomElement,不幸的是它没有 DomDocument 拥有的 saveXML() 方法。 我正在尝试获取 DomElement 的原始 XML 字符串表示形式。 我该怎么做? 最佳答
我是一名优秀的程序员,十分优秀!