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.

draw line from obj, but more than one line from same obj don’t work

Home Forums Puzzles draw line from obj, but more than one line from same obj don’t work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #57098
    Pascal
    Customer

    I have a complex interactive use case, but I break it down to this simple example.
    The given obj is Suzanne, and there are two empty objects. To each Empty, an annotation is added in puzzles.
    I want do draw a line from Suzanne to both annotations, but only the last drawn line is shown.

    Will I have to add one exclusive additional empty as a distinct source for the obj, from where a line is drawn? Or is there another, maybe smarter solution?

    Thanks for your feedback!
    Best regards,
    Pascal

    Attachments:
    You must be logged in to view attached files.
    #57122

    Hi,

    you might use multiple empty objects positioned in the same place, instead of your only main object.

    Chief 3D Verger | LinkedIn | Twitter

    #57123
    Pascal
    Customer

    OK, thank you for confirming the workflow. :good:

    #58983
    kdv
    Participant

    you might use multiple empty objects positioned in the same place, instead of your only main object.

    or you can remove this strange code from the operateLineObjectHTML function

            for (var j = obj.children.length - 1; j >= 0; j--) {
                var child = obj.children[j];
                if (child.isLineHTML) {
                    obj.remove(child);
                    child.geometry.dispose();
                    child.material.dispose();
                }
            }

    what are the reasons to remove already added lines?

    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.

    #59041
    Pascal
    Customer

    what are the reasons to remove already added lines?

    I need to switch on/off interactively the connections (lines) between objects and html-divs, depending on the users input and cursors position. I solved it by adding more empty objects. But thank you for giving this interesting idea how I could hook in alternatively. :good:

    #59042
    kdv
    Participant

    The question was addressed to V3D team. Not to you )))

    I solved it by adding more empty objects

    It’s a workaround. Removing those strings of code will allow you to add as many lines as you want to the same object.

    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.

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