如何修改html游戏数据,从零开始实现放置游戏(四)后台数值配置的增删查改...

package com.idlewow.rms.controller;import com.idlewow.common.model.CommonResult;import com.idlewow.common.model.PageList;import com.idlewow.map.manager.WowMapManager;import com.idlewow.map.model.WowMa...
摘要由CSDN通过智能技术生成

package com.idlewow.rms.controller;

import com.idlewow.common.model.CommonResult;

import com.idlewow.common.model.PageList;

import com.idlewow.map.manager.WowMapManager;

import com.idlewow.map.model.WowMap;

import com.idlewow.query.model.WowMapQueryParam;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.PathVariable;

import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.ResponseBody;

@Controller

@RequestMapping("/manag

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以通过以下步骤实现: 1. 创建一个长方形平面,可以使用 `PlaneGeometry` 类来创建。 2. 创建多个模型,可以使用 `BoxGeometry` 或者其他的几何体来创建,然后再使用 `Mesh` 将几何体和材质组合起来创建出模型。 3. 计算出长方形平面的条边的坐标,可以使用平面的位置、宽度和高度来计算。 4. 将模型放置条边上,可以使用模型的 `position` 属性来设置模型的位置。 5. 将模型放置在多圈上,可以通过循环来实现,计算出每一圈的模型数量和位置,然后将模型放置在对应的位置上。 以下是参考代码: ```javascript // 创建长方形平面 const planeGeometry = new THREE.PlaneGeometry(10, 10); const planeMaterial = new THREE.MeshBasicMaterial({ color: 0xffffff }); const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial); scene.add(planeMesh); // 创建模型 const boxGeometry = new THREE.BoxGeometry(0.5, 0.5, 0.5); const boxMaterial = new THREE.MeshBasicMaterial({ color: 0xff0000 }); const boxMesh = new THREE.Mesh(boxGeometry, boxMaterial); // 计算平面条边的坐标 const position = planeMesh.position.clone(); const width = planeGeometry.parameters.width; const height = planeGeometry.parameters.height; const left = position.clone().add(new THREE.Vector3(-width / 2, 0, 0)); const right = position.clone().add(new THREE.Vector3(width / 2, 0, 0)); const top = position.clone().add(new THREE.Vector3(0, height / 2, 0)); const bottom = position.clone().add(new THREE.Vector3(0, -height / 2, 0)); // 将模型放置条边上 boxMesh.position.copy(left); scene.add(boxMesh.clone().position.copy(right)); scene.add(boxMesh.clone().position.copy(top)); scene.add(boxMesh.clone().position.copy(bottom)); // 将模型放置在多圈上 const circleCount = 3; for (let i = 0; i < circleCount; i++) { const radius = (i + 1) * 1.5; const count = 8 * (i + 1); const angleStep = (2 * Math.PI) / count; for (let j = 0; j < count; j++) { const angle = j * angleStep; const x = radius * Math.cos(angle); const y = radius * Math.sin(angle); scene.add(boxMesh.clone().position.set(x, y, 0)); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值