We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Cycle from list of models

Home Forums Puzzles Cycle from list of models

Tagged: , , ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #55611
    krazy4
    Customer

    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!

    #55617
    kdv
    Participant

    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.

    Need to see your puzzles. There should be two conditions for the last and the first items in the list.

    Puzzles and JS. 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 meaning at all.

    #55618
    krazy4
    Customer

    base_models is the list of models and gltfToLoad is the current model

    Attachments:
    You must be logged in to view attached files.
    #55620
    kdv
    Participant

    For Next button

    For Prev button

    Puzzles and JS. 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 meaning at all.

    #55625
    krazy4
    Customer

    It didn’t work, having same issue

    #55628
    kdv
    Participant

    Did 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/adf

    Puzzles and JS. 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 meaning at all.

    #55632
    krazy4
    Customer

    here’s my puzzle…

    Attachments:
    You must be logged in to view attached files.
    #55634
    kdv
    Participant

    The 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. 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 meaning at all.

    #55636
    krazy4
    Customer

    ok it worked, there was some problem in last model.
    Thanks for your help :)

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.