- This topic has 8 replies, 2 voices, and was last updated 2 years, 2 months ago by krazy4.
-
AuthorPosts
-
2022-09-06 at 12:31 pm #55611krazy4Customer
Hi,
I have a master scene environment where models are loaded from separate file of each 3d model.
In puzzle, I have a defined a list of models which loads with click of next/previous buttons. Everytime we click next/previous, first it unloads the current model and then loads next model from a separate .gltf file. Everything is fine until it reaches the last model in the list because I have defined list concurrence puzzle and get # + 1 puzzle to load the next model.
I have also tried using if/else but it ovelaps when it reaches the last model.
I have seen some loop puzzles on forum but it’s not working somehow maybe I am doing it wrong. Can anyone design a puzzle and share screenshot of that?
Thanks in advance!
2022-09-06 at 2:45 pm #55617kdvParticipantuntil it reaches the last model in the list because I have defined list concurrence puzzle and get # + 1 puzzle to load the next model.
Need to see your puzzles. There should be two conditions for the last and the first items in the list.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-09-06 at 3:07 pm #55618krazy4Customerbase_models is the list of models and gltfToLoad is the current model
Attachments:
You must be logged in to view attached files.2022-09-06 at 3:23 pm #55620kdvParticipantFor
Next
button
For
Prev
button
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-09-06 at 3:41 pm #55625krazy4CustomerIt didn’t work, having same issue
2022-09-06 at 3:50 pm #55628kdvParticipantDid something wrong. It must work. These are the elementary conditions for skipping from the last to the first item in a list and vice versa.
This demo appends models cyclically
https://v3d.net/adfPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-09-06 at 4:29 pm #556322022-09-06 at 4:35 pm #55634kdvParticipantThe puzzles are correct to skip from the last item to the first one.
I have the same puzzle set and it skips from 0 to 4 and from 4 to 0
p.s. use
print to console
puzzle to control what index is chosen. You can control every step in the browser console to see what’s wrong…Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-09-06 at 5:01 pm #55636krazy4Customerok it worked, there was some problem in last model.
Thanks for your help :) -
AuthorPosts
- You must be logged in to reply to this topic.