- This topic has 10 replies, 3 voices, and was last updated 5 years, 11 months ago by HoboCat.
-
AuthorPosts
-
2018-11-30 at 5:23 pm #9375Alby90Participant
Good evening!
I’m experimenting with Verge3D and i want to ask some questions:
is there a way to add items to a folder (some textures, for example) and then, when starting the program, store them in an Array in order to be used in runtime?
I give an example: in a folder I have 3 textures. I want to save them in an Array for loading when needed. If then I need to add another texture I just have to add it to the folder to be able to apply it to my material at the next use of the program.
I saw that there is a “load file” puzzle that can be used for this purpose, am i right?
Thanks in advance2018-12-01 at 1:23 pm #9383Yuri KovelenovStaffHi!
You can possibly use the replace texture puzzle that loads images on demand. We did so in our newest Scooter demo and this allowed us to halve the overall file size.
2018-12-03 at 3:37 pm #9445Alby90ParticipantYeah, i have already used this puzzle and it is very usefull for getting the texture, but if i want to make a system like the one i have described previously i need to know how many files i have in a folder. Is that possible in some way using the puzzle?
Thanks in advance2018-12-03 at 3:54 pm #9446Yuri KovelenovStaffI see. I’m afraid the web browser is too restricted to directly read the contents of a folder on the server. You can, however, create a manifest file in which you can list all the images. This file then can be loaded with the load file puzzle. Finally you can use some Text puzzles to retrieve those file paths and load your textures.
You can also automate the updating of the manifest file by writing some server side script which will be looking in your folder and retrieve all the files from it.
2018-12-04 at 5:35 am #9464HoboCatCustomerHello,
First off all I wanted to thank the creators for such a great app! it gives huge opportunities for developers!
I wanted to ask a bit simmilar thing to this topic.
How about if I want to change images dynamicaly with new names?
My planned scenario: user uploads a file to a server, then jQuery returns a path to uploaded file and then Verge3d uses “replace texture” puzzle to change an existing texture in model to the new one.
So the question would be: what would be the workflow of giving the path to file from html to “replace_texture input” and also what would be the method to initiate “replace_texture” from html click?2018-12-04 at 6:45 am #9466Yuri KovelenovStaffHi!
So the question would be: what would be the workflow of giving the path to file from html to “replace_texture input” and also what would be the method to initiate “replace_texture” from html click?
You can use when called from JS puzzle for that – see the description and an example here: https://www.soft8soft.com/docs/manual/en/introduction/Puzzles.html#when_called_from_JS
2018-12-04 at 11:27 am #9485HoboCatCustomerThank you!
2018-12-04 at 1:18 pm #9502Yuri KovelenovStaff2018-12-22 at 6:42 pm #10163HoboCatCustomerHello again,
just wanted to ask, if there is a possibility to make verge3d load an image not from server but from user input: for example user add an image file to html “upload”, then javascript loads that image> then verge3d loads that image and then “replace_texture” uses loaded image to replace the old texture? if yes what would be the way to make verge3d to load the image from javascript?2018-12-23 at 9:45 am #10170Yuri KovelenovStaff2018-12-28 at 10:45 am #10245HoboCatCustomerYep, thank you! just gonna need to get some javascript knowledge to understand the mechanism.
-
AuthorPosts
- You must be logged in to reply to this topic.