Merge pull request 'bx-1480-calc' (#81) from bx-1480-calc into dev
Reviewed-on: #81
This commit is contained in:
commit
e240adfb10
|
@ -56,15 +56,10 @@ onMounted(() => {
|
|||
<TresCanvas height="600">
|
||||
<TresPerspectiveCamera :position="[-7, 2, 4]" ref="camera" />
|
||||
<OrbitControls v-bind="controlsState" ref="controls" make-default />
|
||||
<ModelEnv />
|
||||
<Suspense>
|
||||
<ModelDiagram />
|
||||
</Suspense>
|
||||
|
||||
<TresPointLight v-bind="back_light" v-if="back_light"
|
||||
:position="[back_light.position.x, back_light.position.y, back_light.position.z]" />
|
||||
<TresPointLight v-bind="secondary_light" v-if="secondary_light"
|
||||
:position="[secondary_light.position.x, secondary_light.position.y, secondary_light.position.z]" />
|
||||
<!-- <TresAmbientLight :intensity="2" /> -->
|
||||
</TresCanvas>
|
||||
</ClientOnly>
|
||||
<div class="canvas-icons">
|
||||
|
|
|
@ -189,7 +189,7 @@ const total_txt = computed(() => {
|
|||
if (isTopper) decor.topper = { txt: 'Колпак', value: getTopperName(pillar_topper.value) }
|
||||
}
|
||||
|
||||
const total = [extra, regular, decor].map(item => Object.values(item).map(el => el ? el.value : 0)).flat().reduce((a, b) => a + b, 0)
|
||||
const total = [extra, regular].map(item => Object.values(item).map(el => el ? el.value : 0)).flat().reduce((a, b) => a + b, 0)
|
||||
|
||||
const res_regular = Object.values(regular).map(item =>
|
||||
Object.entries(item).map(el => el[0] == 'value' ? roubleSign.format(el[1] as number) : el[1]).join(': ')
|
||||
|
|
|
@ -25,8 +25,8 @@ const { scene: verh } = await useGLTF('/models_exp/verh.glb')
|
|||
const lamelle_color = use_lamelle_color()
|
||||
const pillar_color = use_pillar_color()
|
||||
|
||||
set_material(planki, getColorHexFromRal(lamelle_color.value));
|
||||
[stolb, verh, krepleniye_planok].map(el => set_material(el, getColorHexFromRal(pillar_color.value)))
|
||||
set_material(planki, getColorHexFromRal(lamelle_color.value), undefined, false);
|
||||
[stolb, verh, krepleniye_planok].map(el => set_material(el, getColorHexFromRal(pillar_color.value), undefined, false))
|
||||
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -142,7 +142,7 @@ const setPillar = () => {
|
|||
pillar_inner.scale.setComponent(1, lamelles_count.value);
|
||||
|
||||
const bottom = props.models.pillar_bottom.children[0];
|
||||
bottom.position.setComponent(1, lSize * -1);
|
||||
bottom.position.setComponent(1, lSize * -0.5);
|
||||
|
||||
let arr = [top, pillar_outer, pillar_inner, bottom]
|
||||
arr.map(el => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export const toppers = [
|
||||
{ name: 'Ровный', filename: 'icon_stolb_verh_3.svg', model: 'top' },
|
||||
{ name: 'Вершина 1', filename: 'icon_stolb_verh_2.svg', model: 'decor1' },
|
||||
{ name: 'Вершина 2', filename: 'icon_stolb_verh_1.svg', model: 'decor3' },
|
||||
{ name: 'Вершина 2', filename: 'icon_stolb_verh_1.svg', model: 'decor2' },
|
||||
].map((el, i) => Object.assign(el, { id: i }))
|
||||
|
||||
export const getFilename = (id: toppersIds) => {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
Color, DoubleSide,
|
||||
MeshStandardMaterial, RepeatWrapping,
|
||||
Texture, TextureLoader,
|
||||
Texture, TextureLoader,
|
||||
type WebGLProgramParameters
|
||||
} from "three"
|
||||
import { useLoader, } from '@tresjs/core'
|
||||
|
@ -75,12 +75,18 @@ const m_onBeforeCompile = (shader: WebGLProgramParameters) => {
|
|||
`
|
||||
);
|
||||
};
|
||||
export const set_material = (scene: any, color: any, pattern: { pattern: patternIds, count: number } | undefined = undefined) => {
|
||||
export const set_material = (
|
||||
scene: any,
|
||||
color: any,
|
||||
pattern: { pattern: patternIds, count: number } | undefined = undefined,
|
||||
noise_material: boolean = true,
|
||||
) => {
|
||||
let c = color
|
||||
|
||||
const material = noiseMaterial.clone()
|
||||
material.color = new Color(c || '#9c9c00')
|
||||
material.onBeforeCompile = m_onBeforeCompile
|
||||
if (noise_material) {
|
||||
material.onBeforeCompile = m_onBeforeCompile
|
||||
}
|
||||
|
||||
const promises = []
|
||||
if (pattern && pattern.pattern !== undefined) {
|
||||
|
@ -93,6 +99,7 @@ export const set_material = (scene: any, color: any, pattern: { pattern: pattern
|
|||
res.repeat.set(1, pattern.count);
|
||||
res.needsUpdate = true
|
||||
material.alphaMap = res
|
||||
scene.renderOrder = 0
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue