3DStreet / 3dstreet

🚲🚢🚌 Web-based 3D visualization of streets using A-Frame
https://3dstreet.app
Other
249 stars 30 forks source link

ability to have image previews for models #632

Open kfarr opened 2 weeks ago

kfarr commented 2 weeks ago
Algorush commented 1 week ago

We can try to generate model images automatically. Write a function that will take images of all models. If all models are already loaded into page memory, then this should not take up many resources?? But I'm not sure if this is a good idea. Maybe It might be better to have such a generator as a separate script, which will create images of models and place them in a separate folder. The downside here is that we will have to load all images of models onto the page from the server

kfarr commented 1 week ago

@Algorush we already have a script that can generate jpegs from gltf, see https://github.com/3DStreet/citybuilderjr

this task is the ability for the add entity panel to reference some sort of json like catalog.json for the image file. How we create the image file is a task for another ticket (or to be done manually)

Algorush commented 1 week ago

this task is the ability for the add entity panel to reference some sort of json like catalog.json for the image file.

Ok, got it. Now there is a file cardsData.js, where img, icon, name for each mixinId can be stored. It is better to rename it to mixinsData.js, because there will be only mixins data now. Use this data in the getGroupedMixinOptions function in addLayerPanel: https://github.com/3DStreet/3dstreet/blob/95b81ab695050f92be0884dd48ecfb0d862a4d0b/src/editor/components/components/AddLayerPanel/AddLayerPanel.component.jsx#L52-L58 We can also remove the grouping logic from this function and instead divide the mixins into groups inside mixinsData.js. Like in src/assets.js.

kfarr commented 14 hours ago

@Algorush I tried adding an image to Bicycle_1 mixin in this branch: https://github.com/3DStreet/3dstreet/pull/683 but I was not able to make it work. Can you check it out and suggest what I might be doing wrong?

Algorush commented 14 hours ago

@Algorush I tried adding an image to Bicycle_1 mixin in this branch: #683 but I was not able to make it work. Can you check it out and suggest what I might be doing wrong?

also need to import mixinsData from cardsData.js file in AddLayerPanel.component.js and add img: mixinsData[mixinId] here: https://github.com/3DStreet/3dstreet/blob/95b81ab695050f92be0884dd48ecfb0d862a4d0b/src/editor/components/components/AddLayerPanel/AddLayerPanel.component.jsx#L52-L58 same for description. I was mention here about it: https://github.com/3DStreet/3dstreet/issues/632#issuecomment-2183035582