Merge pull request 'test calc' (#36) from bx-1047-main into dev
Reviewed-on: #36
This commit is contained in:
commit
f0210f60ea
|
@ -62,7 +62,7 @@ watch([section_count, extra_section], () => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Loader />
|
<Loader />
|
||||||
<TresCanvas shadows>
|
<TresCanvas preset="realistic">
|
||||||
<TresPerspectiveCamera v-bind="cameraStat" ref="camera" />
|
<TresPerspectiveCamera v-bind="cameraStat" ref="camera" />
|
||||||
<OrbitControls v-bind="controlsState" make-default />
|
<OrbitControls v-bind="controlsState" make-default />
|
||||||
<TresGroup :position-x="Math.min(section_count, max_size) * fence_section * -1" :position-y="-3">
|
<TresGroup :position-x="Math.min(section_count, max_size) * fence_section * -1" :position-y="-3">
|
||||||
|
|
|
@ -43,6 +43,7 @@ const form_state = reactive({
|
||||||
auto_length: true,
|
auto_length: true,
|
||||||
remove_pillar: false
|
remove_pillar: false
|
||||||
})
|
})
|
||||||
|
let copy_form_state = Object.assign({}, form_state)
|
||||||
const form_refs = {
|
const form_refs = {
|
||||||
length: ref(),
|
length: ref(),
|
||||||
height: ref(),
|
height: ref(),
|
||||||
|
@ -50,9 +51,13 @@ const form_refs = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeParametres = () => {
|
const changeParametres = () => {
|
||||||
if (form_state.total_length * 1000 < parametric.length.min) {
|
// console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000)
|
||||||
|
|
||||||
|
if ((form_state.total_length * 1000) <= (parametric.length.min + parametric.height.step)) {
|
||||||
|
form_state.total_length = (parametric.length.min + parametric.height.step) / 1000
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const lamelles = Math.floor(form_state.height / parametric.height.step)
|
const lamelles = Math.floor(form_state.height / parametric.height.step)
|
||||||
|
|
||||||
for (const key in form_state) {
|
for (const key in form_state) {
|
||||||
|
@ -68,7 +73,7 @@ const changeParametres = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form_state.total_length_mm < form_state.length) {
|
if (form_state.total_length_mm < form_state.length) {
|
||||||
form_state.length = form_state.total_length_mm
|
// form_state.length = form_state.total_length_mm
|
||||||
}
|
}
|
||||||
form_state.total_length_mm = form_state.total_length * 1000
|
form_state.total_length_mm = form_state.total_length * 1000
|
||||||
|
|
||||||
|
@ -109,6 +114,8 @@ const changeParametres = () => {
|
||||||
form_state.length = length
|
form_state.length = length
|
||||||
form_state.fence_length = fence_length
|
form_state.fence_length = fence_length
|
||||||
|
|
||||||
|
copy_form_state = Object.assign({}, form_state)
|
||||||
|
|
||||||
total_length.value = form_state.total_length
|
total_length.value = form_state.total_length
|
||||||
lamelles_count.value = lamelles
|
lamelles_count.value = lamelles
|
||||||
fence_section.value = form_state.length * 0.001
|
fence_section.value = form_state.length * 0.001
|
||||||
|
@ -125,17 +132,12 @@ const setLamelleColor = (color: ralTypes) => {
|
||||||
const setPillarColor = (color: ralTypes) => {
|
const setPillarColor = (color: ralTypes) => {
|
||||||
pillar_color.value = color
|
pillar_color.value = color
|
||||||
}
|
}
|
||||||
watch(form_state, changeParametres, { deep: true })
|
watch(() => form_state, changeParametres, { deep: true })
|
||||||
|
|
||||||
const isModalOpen = useState('modal_open', () => false)
|
const isModalOpen = useState('modal_open', () => false)
|
||||||
const toggleModal = () => {
|
const toggleModal = () => {
|
||||||
isModalOpen.value = !isModalOpen.value
|
isModalOpen.value = !isModalOpen.value
|
||||||
}
|
}
|
||||||
const plurals = {
|
|
||||||
lamelle: { one: 'ламель', few: 'ламели', many: 'ламелей' },
|
|
||||||
fence: { one: 'cтолб', few: 'столба', many: 'столбов' },
|
|
||||||
section: { one: 'секция', few: 'секции', many: 'секций' },
|
|
||||||
}
|
|
||||||
const goal = (target: string, params: object) => {
|
const goal = (target: string, params: object) => {
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
if (nuxtApp.$metrika) {
|
if (nuxtApp.$metrika) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ onMounted(() => {
|
||||||
Загрузка 3D модели
|
Загрузка 3D модели
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<TresCanvas height="600">
|
<TresCanvas height="600" preset="realistic" render-mode="on-demand">
|
||||||
<TresPerspectiveCamera :position="[-7, 2, 4]" ref="camera" />
|
<TresPerspectiveCamera :position="[-7, 2, 4]" ref="camera" />
|
||||||
<OrbitControls v-bind="controlsState" ref="controls" make-default />
|
<OrbitControls v-bind="controlsState" ref="controls" make-default />
|
||||||
<Suspense>
|
<Suspense>
|
||||||
|
|
|
@ -15,7 +15,7 @@ const section_count = use_section_count()
|
||||||
const extra_section = use_extra_section()
|
const extra_section = use_extra_section()
|
||||||
const max_size = use_max_size()
|
const max_size = use_max_size()
|
||||||
|
|
||||||
const { scene, renderer } = useTresContext()
|
const { scene, renderer, camera } = useTresContext()
|
||||||
renderer.value.toneMapping = CineonToneMapping
|
renderer.value.toneMapping = CineonToneMapping
|
||||||
renderer.value.toneMappingExposure = 0.5
|
renderer.value.toneMappingExposure = 0.5
|
||||||
// renderer.value.gammaOutput = true
|
// renderer.value.gammaOutput = true
|
||||||
|
@ -72,6 +72,7 @@ onMounted(async () => {
|
||||||
'hdrmaps/hdr-gainmap.webp',
|
'hdrmaps/hdr-gainmap.webp',
|
||||||
'hdrmaps/hdr.json',
|
'hdrmaps/hdr.json',
|
||||||
])
|
])
|
||||||
|
renderer.value.render(scene.value, camera.value)
|
||||||
scene.value.environment = result.renderTarget.texture
|
scene.value.environment = result.renderTarget.texture
|
||||||
scene.value.background = result.renderTarget.texture
|
scene.value.background = result.renderTarget.texture
|
||||||
scene.value.background.mapping = EquirectangularReflectionMapping
|
scene.value.background.mapping = EquirectangularReflectionMapping
|
||||||
|
|
Loading…
Reference in New Issue