position
This commit is contained in:
parent
fdc3cf626c
commit
874f69f295
File diff suppressed because it is too large
Load Diff
|
@ -31,12 +31,15 @@ class Environment(models.Model):
|
||||||
|
|
||||||
|
|
||||||
class Element3D(models.Model):
|
class Element3D(models.Model):
|
||||||
parent = models.ForeignKey("self", on_delete=models.PROTECT, blank=True, null=True)
|
|
||||||
model_file = models.FileField(upload_to=group_based_upload_to)
|
model_file = models.FileField(upload_to=group_based_upload_to)
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
description = models.TextField(blank=True, null=True)
|
description = models.TextField(blank=True, null=True)
|
||||||
is_enabled = models.BooleanField(default=True)
|
is_enabled = models.BooleanField(default=True)
|
||||||
can_not_disable = models.BooleanField(default=False)
|
can_not_disable = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
x_pos = models.IntegerField(default=0)
|
||||||
|
y_pos = models.IntegerField(default=0)
|
||||||
|
z_pos = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
VITE_SERVER_URL='https://demo.kustarshina.ru'
|
VITE_SERVER_URL='https://demo.kustarshina.ru'
|
||||||
VITE_IMAGE_URL='https://demo.kustarshina.ru'
|
VITE_IMAGE_URL='https://demo.kustarshina.ru'
|
||||||
VITE_SERVER_URL='https://demo.kustarshina.ru'
|
VITE_SERVER_URL='https://demo.kustarshina.ru'
|
||||||
|
VITE_SERVER_URL='http://localhost:8000'
|
|
@ -42,7 +42,7 @@ const groundTexture = await useTexture({
|
||||||
})
|
})
|
||||||
|
|
||||||
const timer = ref(10)
|
const timer = ref(10)
|
||||||
let int:any;
|
let int: any;
|
||||||
|
|
||||||
// renderer.value.capabilities.maxTextures = 4
|
// renderer.value.capabilities.maxTextures = 4
|
||||||
renderer.value.capabilities.maxTextureSize = 512
|
renderer.value.capabilities.maxTextureSize = 512
|
||||||
|
@ -98,6 +98,8 @@ const loadModels = async () => {
|
||||||
item.modelFile.visible = false
|
item.modelFile.visible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item.modelFile.position.set(element.x_pos || 0, element.y_pos || 0, element.z_pos || 0)
|
||||||
|
|
||||||
models.value.push(item)
|
models.value.push(item)
|
||||||
|
|
||||||
const res = await fetch(`${SERVER_URL}/api/obj/clickable/?source=${element.id}`)
|
const res = await fetch(`${SERVER_URL}/api/obj/clickable/?source=${element.id}`)
|
||||||
|
@ -302,8 +304,8 @@ watch(() => sidebar_scene.list, () => {
|
||||||
<TresGroup name="loaded">
|
<TresGroup name="loaded">
|
||||||
<Env v-bind="envVars" />
|
<Env v-bind="envVars" />
|
||||||
<template v-for="item in models">
|
<template v-for="item in models">
|
||||||
<TresGroup :name="item.name">
|
<TresGroup :name="item.name" >
|
||||||
<TresObject3D v-bind="item.modelFile.clone()" />
|
<TresObject3D v-bind="item.modelFile.clone()"/>
|
||||||
</TresGroup>
|
</TresGroup>
|
||||||
</template>
|
</template>
|
||||||
<template v-for="(item, i) in clickable_items">
|
<template v-for="(item, i) in clickable_items">
|
||||||
|
|
Loading…
Reference in New Issue