three调用openai的ai api动态生成渲染下载三维glb模型代码
代码语言:html
所属分类:三维
代码描述:three调用openai的ai api动态生成渲染下载三维glb模型代码,输入openai的apikey,其他兼容openai的ai大模型也能使用,通过动态生成three的模型js进行执行渲染生成三维模型并下载glb到本地。
代码标签: three 调用 openai ai api 动态 生成 渲染 下载 三维 glb 模型 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>AI 生成三维模型 (Three.js + OpenAI)</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
margin: 0;
overflow: hidden;
background-color: #333;
color: white;
display: flex;
}
#controls {
width: 350px;
background-color: #282c34;
padding: 20px;
box-sizing: border-box;
overflow-y: auto;
height: 100vh;
}
#canvas-container {
flex-grow: 1;
height: 100vh;
}
h2 {
margin-top: 0;
border-bottom: 1px solid #444;
padding-bottom: 10px;
}
.input-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="password"], textarea {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #555;
background-color: #333;
color: white;
box-sizing: border-box;
font-size: 14px;
}
textarea {
resize: vertical;
min-height: 100px;
}
button {
width: 100%;
padding: 12px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
#generate-btn {
background-color: #007bff;
color: white;
}
#download-btn {
background-color: #28a745;
color: white;
margin-top: 10px;
}
button:disabled {
background-color: #555;
cursor: not-allowed;
}
#loader-overlay {
position: ab.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0