Javascript Jquery在悬停时停止旋转
Javascript Jquery在悬停时停止旋转,javascript,jquery,Javascript,Jquery,$(函数(){ 摄像机、渲染器; var mpi=Math.PI/180; 循环变异系数=1000; var-startAngle=0; var centerX=0; var centerZ=0; var startRadians=startAngle+mpi; var=4; var incrementAngle=360/totalSpheres; var增量弧度=增量角度*mpi; 变量元素=功能(id、dat、位置、旋转){ 变量html=[ '', “”, “”, '', '', “”,
$(函数(){
摄像机、渲染器;
var mpi=Math.PI/180;
循环变异系数=1000;
var-startAngle=0;
var centerX=0;
var centerZ=0;
var startRadians=startAngle+mpi;
var=4;
var incrementAngle=360/totalSpheres;
var增量弧度=增量角度*mpi;
变量元素=功能(id、dat、位置、旋转){
变量html=[
'',
“”,
“- ”,
'',
'',
“
”,
“
”,
''
].join('\n');
var div=document.createElement('div');
$(div).html(html);
var对象=新的三个.CSS3DObject(div);
object.position.x=position.x;
object.position.y=position.y;
object.position.z=position.z;
object.rotation.x=rotation.x;
object.rotation.y=rotation.y;
object.rotation.z=rotation.z;
返回对象;
}
init();
制作动画();
函数init(){
场景=新的三个。场景();
var container=document.getElementById('container');
renderer=new THREE.css3drender();
渲染器.setSize(window.innerWidth,window.innerHeight*.85);
container.appendChild(renderer.doElement);
摄像头=新的三个透视摄像头(50,window.innerWidth/window.innerHeight,1,10);
摄像机位置设置(-100,604000);
camera.updateMatrix();//确保更新了camera的本地矩阵
camera.UpdateMatrix();//确保更新了camera的世界矩阵
camera.matrixWorldInverse.getInverse(camera.matrixWorld);
var group=新的三个.group();
var str={
“攻击者”:.ajax({
数据类型:“文本”,
url:“http://localhost/liberate/threeee/PAGES/Information/content.html",
成功:函数(数据){
控制台日志(数据);
$(“#攻击者”).append(数据)
}}),
“defender”:.ajax美元({
数据类型:“文本”,
url:“http://localhost/liberate/threeee/PAGES/Information/defender.html",
成功:函数(数据){
控制台日志(数据);
$(“#defender”)。追加(数据)
}}),
“守门员”:.ajax({
数据类型:“文本”,
url:“http://localhost/liberate/threeee/PAGES/Information/content.html",
成功:函数(数据){
控制台日志(数据);
$(“#守门员”)。附加(数据)
}}),
“中场球员”:.ajax({
数据类型:“文本”,
url:“http://localhost/liberate/threeee/PAGES/Information/midfielder.html",
成功:函数(数据){
控制台日志(数据);
$(“#中场”)。追加(数据)
}})
}
var allKeys=Object.keys(str);
对于(var i=0;i
场景.rotation.y=0不起作用?能否显示更多代码?您如何使用html
?不,它不起作用。我试过了,整个代码有点乱。但我可以发布。稍等片刻TechCheck我已经为你发布了整个脚本@Dij