Ai
263 Star 4K Fork 923

ICEGL/icegl-three-vue-tres

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
outlineCom.vue 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
地虎降天龙 提交于 2025-09-24 16:12 +08:00 . 基础的 材质 - materials 已完善
<!--
* @Description:
* @Version: 1.668
* @Autor: 地虎降天龙
* @Date: 2024-01-09 17:15:51
* @LastEditors: 地虎降天龙
* @LastEditTime: 2024-04-23 20:20:17
-->
<template>
<primitive :object="ol.group" />
</template>
<script setup lang="ts">
import * as THREE from 'three'
import { useTres } from '@tresjs/core'
import { Outlines } from '@pmndrs/vanilla'
import { onMounted, watchEffect } from 'vue'
const props = withDefaults(
defineProps<{
color?: string
thickness?: number
screenspace?: boolean
}>(),
{
color: '#ffffff',
thickness: 0.1,
screenspace: false,
},
)
const { renderer } = useTres()
const ol = Outlines({
color: new THREE.Color(props.color),
thickness: props.thickness,
screenspace: props.screenspace,
gl: renderer,
})
onMounted(() => {
ol.generate()
})
watchEffect(() => {
ol.updateProps({
color: new THREE.Color(props.color),
thickness: props.thickness,
screenspace: props.screenspace,
})
})
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ice-gl/icegl-three-vue-tres.git
git@gitee.com:ice-gl/icegl-three-vue-tres.git
ice-gl
icegl-three-vue-tres
icegl-three-vue-tres
master

搜索帮助