three实现二维草图户型图图纸做底片绘制三维户型图代码
代码语言:html
所属分类:三维
代码描述:three实现二维草图户型图图纸做底片绘制三维户型图代码
代码标签: three 二维 草图 户型图 图纸 做 底片 绘制 三维 户型图 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2D转3D 户型编辑器</title>
<style>
body { margin: 0; display: flex; height: 100vh; overflow: hidden; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #222; }
/* 左侧工具栏 */
#toolbar {
width: 260px;
background: #f8f9fa;
padding: 15px;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 8px;
overflow-y: auto;
border-right: 1px solid #ccc;
box-shadow: 2px 0 5px rgba(0,0,0,0.1);
z-index: 10;
}
h3 { margin: 0 0 10px 0; font-size: 18px; color: #333; text-align: center; }
hr { border: 0; border-top: 1px solid #ddd; margin: 10px 0; width: 100%; }
label { font-size: 13px; font-weight: bold; color: #555; margin-top: 5px; }
.btn {
padding: 10px;
background: #fff;
border: 1px solid #ccc;
border-radius: 6px;
cursor: pointer;
text-align: left;
transition: all 0.2s;
font-size: 14px;
}
.btn:hover { background: #e9ecef; }
.btn.active { background: #0d6efd; color: white; border-color: #0d6efd; }
input[type="range"] { width: 100%; cursor: pointer; }
input[type="file"] { font-size: 12px; margin-bottom: 5px; }
/* 布局容器 */
#main-area { flex: 1; display: flex; flex-direction: row; }
/* 2D 编辑器 */
#editor-container {
flex: 1;
position: relative;
background: #ffffff;
background-image: linear-gradient(#f0f0f0 1px, transparent 1px), linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
background-size: 20px 20px;
border-right: 2px solid #333;
}
#canvas-2d { position: absolute; top: 0; left: 0; cursor: crosshair; }
/* 3D 预览区 */
#preview-container { flex: 1; position: relative; background: #1a1a1a; }
.tip { font-size: 12px; color: #666; background: #fff3cd; padding: 8px; border-radius: 4px; border: 1px solid #ffe69c; }
</style>
<!-- 配置 Three.js Import Map -->
<script type="importmap">
{
"i.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0