Tagged: Code, draw line, javascript, puzzle, xml
- This topic has 22 replies, 2 voices, and was last updated 1 year, 2 months ago by kdv.
-
AuthorPosts
-
2023-10-20 at 9:02 am #67727alejandro88Participant
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!
- This topic was modified 1 year, 2 months ago by alejandro88.
- This topic was modified 1 year, 2 months ago by alejandro88.
- This topic was modified 1 year, 2 months ago by alejandro88.
Attachments:
You must be logged in to view attached files.2023-10-20 at 11:38 am #67734kdvParticipantSet 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.
2023-10-20 at 11:49 am #67735alejandro88ParticipantThanks 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.
2023-10-20 at 12:20 pm #67736kdvParticipantdeleted
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.
2023-10-20 at 12:35 pm #67737alejandro88ParticipantThank 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!
2023-10-20 at 12:38 pm #67738kdvParticipantdeleted
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.
2023-10-20 at 1:26 pm #67741kdvParticipant2023-10-20 at 1:27 pm #67744alejandro88ParticipantOh 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!!
2023-10-20 at 1:31 pm #67745kdvParticipantForget 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.
2023-10-20 at 1:44 pm #67746alejandro88ParticipantSo 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!
2023-10-20 at 1:46 pm #67747kdvParticipantdeleted
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.
2023-10-21 at 4:27 am #67760kdvParticipantminified 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 afterv3d.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.
2023-10-21 at 9:39 pm #67784alejandro88ParticipantHey! 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!
Any ideas :D ?
I attached a picture!
Thanks again!
- This reply was modified 1 year, 2 months ago by alejandro88.
Attachments:
You must be logged in to view attached files.2023-10-22 at 4:08 am #67798kdvParticipantLooks 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.
2023-10-23 at 6:58 am #67819alejandro88ParticipantHey 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!
- This reply was modified 1 year, 2 months ago by alejandro88.
Attachments:
You must be logged in to view attached files. -
AuthorPosts
- You must be logged in to reply to this topic.