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 function doesn’t accept all colors

Home Forums Puzzles Draw Line function doesn’t accept all colors

  • This topic has 22 replies, 2 voices, and was last updated 1 year ago by kdv.
Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #67727
    alejandro88
    Participant

    Hello Soft8Soft team!

    I’m Alejandro, 3D developper from France, and I’ve been working on a 3D app that allows you to see and interact with a 3D valve. This valve has some annotations and I do some HTML Pop-up windows next to them. I’ve been struggling because I make a line that joins a 3D object with my Pop-up window and it seems like the line does not accept ALL colors, but instead a very specific list of roughly 30 color codes. I need to give the line a very specific line color that is not in the list (#FAD345) and I would like to know which would be the right approach to get that?

    I’ve attached a picture that show the color I want and the color of the line (not the right color).

    I’ve already tried to change the color code inside the XML file (puzzle file), and I can’t find the function inside the JS files that does the line.

    Thanks in advance! :bye:

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

    Set the color of your annotations close to the color of the line and forget.

    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.

    #67735
    alejandro88
    Participant

    Thanks you a lot for your help!

    The color of my annotations is fixed and I should not change it (project constraints), so I should be able to change the line to this exact color #FAD345.

    #67736
    kdv
    Participant

    deleted

    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.

    #67737
    alejandro88
    Participant

    Thank you Kdv!

    So I guess it’s not possible pfr now to freely give to my line a sRGB color. I will try to use canvas in HTML to make the lines between HTML elements.

    Cheers! B-)

    #67738
    kdv
    Participant

    deleted

    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.

    #67741
    kdv
    Participant

    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.

    #67744
    alejandro88
    Participant

    Oh it’s excellent! My v3d.js file is ‘encrypted’, all the code is within one continuous line of code. Do you know how can I get the real file so I can edit it?

    Thank you!!

    #67745
    kdv
    Participant

    Forget about v3d.js. It’s OK with it. The fix should be applied in puzzles.min.js.

    My v3d.js file is ‘encrypted’

    It’s not encrypted, it’s just minified to one string…

    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.

    #67746
    alejandro88
    Participant

    So I guess I would need the Entreprise License to be able to edit this file, because the one I have (with the free license) is a minified puzzles.min.js and not possible to find the line of code you talk about, but this is the solution to the problem I was looking for!

    I see you tested it and it worked so I would have to implement that in my files.

    Thanks a lot Kdv! :good:

    #67747
    kdv
    Participant

    deleted

    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.

    #67760
    kdv
    Participant

    minified puzzles.min.js and not possible to find the line

    Open puzzles.min.js in your favorite text editor Notepad++, hit F3. Paste this line into the search field
    v3d.LineHTML(new v3d.Color(color)

    The search result will be only one piece of code.
    Add .convertSRGBToLinear() right after v3d.Color(color). Save. Easy.

    The result should look this way

    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.

    #67784
    alejandro88
    Participant

    Hey! Thanks for your speed in answering!

    I tried to do what you did but at first, when I try to add this code and I hit ‘save’, it says that the file cannot be modified, the acces is refused, so I copy pasted the file on my desktop, I edited it and replaced the original. I tried making a line with this color (#FAD345) and a div in the parent document with a background color (#FAD345) and colors don’t match :( but in your exemple, your color is good! I don’t see what I am doing wrong! :unsure:

    Any ideas :D ?

    I attached a picture!

    Thanks again!

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

    Looks like for 4.5.0pre2 this fix in puzzles.min.js is not needed. The color is already matching.

    Do you use HDR rendering in you project? In this case the color will be different from the original.

    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.

    #67819
    alejandro88
    Participant

    Hey Kdv!

    I downloaded the 4.5.0pre2 version for Maya, and it doesn’t seem to work. The color doesn’t change and I see in your picture, that your line and yellow box match. I tried deleting all the files from the previous version and installing 4.5.0pre2 from scratch. No success.

    I’m not exporting in HDR so it’s even more strange this final line color.

    Which 3D software are you using? I don’t think that the problem comes from that, but it’s the only thing that might be different. ;-) Or is it because i’m using the free version of Verge 3D…?

    Thanks a lot!

    Attachments:
    You must be logged in to view attached files.
Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.