ai转头抬头 ai怎么做旋转箭头
const scene = new THREE.Scene;
const aiModel = loadAIModel; // 加载AI模型
// 转头抬头控制
function rotateHead(horizontal, vertical) {
aiModel.neck.rotation.y = horizontal; // 左右转头
aiModel.head.rotation.x = vertical; // 上下抬头
// 箭头旋转控制
const arrow = new THREE.Mesh(
new THREE.ConeGeometry(0.5, 2, 4),
new THREE.MeshBasicMaterial({color: 0xff0000})
);
arrow.rotation.z = Math.PI/2; // 初始旋转
function rotateArrow(angle) {
arrow.rotation.z = angle;
/ AI头部旋转 /
.ai-head {
transition: transform 0.3s;
.look-left { transform: rotateY(-15deg); }
.look-right { transform: rotateY(15deg); }
.look-up { transform: rotateX(15deg); }
.look-down { transform: rotateX(-15deg); }
/ 旋转箭头 /
.arrow {
width: 20px;
height: 20px;
background: red;
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transition: transform 0.5s;
.rotate-arrow {
transform: rotate(180deg);