Parametric design in MoI?
 1-13  …  854-873  874-893  894-912

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.894 In reply to 7713.893 
I ended up with an error!



I have downloaded "nodeeditor.zip" from: http://moi3d.com/forum/index.php?webtag=MOI&msg=9949.12 (Post number = 9949.12)
then I extracted the zip file into ...AppData\Roaming\Moi

and then I made a shortcut for it "Alt+N" and added : ​moi.ui.createDialog( 'moi://appdata/nodeeditor/index.html', 'resizeable,defaultWidth:680,defaultHeight:420', moi.ui.mainWindow );

but I ended up with an error!

What should I do?

EDITED: 6 May 2021 by DRILLBIT

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7713.895 In reply to 7713.894 
Hi Psygorn, that error means you've got some unusual text characters inserted into the shortcut key text. Maybe if you're preparing the text in a word processor that has styles and such applied to it that is carrying along some extra stuff. Try using a plain text editor or set the document type to be plain text.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7713.896 In reply to 7713.894 
Did you get that text by selecting and copying from a web page? If so which page, maybe I can fix the page to not have fancy unicode control characters in what is supposed to be plain text for code.

Try this:

code:
script:moi.ui.createDialog("moi://appdata/nodeeditor/index.html","resizeable,defaultWidth:680,defaultHeight:420",moi.ui.mainWindow);


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.897 In reply to 7713.895 
Is that it:



I used this piece of code for a short key:

script: if ( moi.majorVersionNumber == 3 ) { moi.ui.createDialog( 'nodeeditor/index.html', 'resizeable,defaultWidth:680,defaultHeight:420', moi.ui.mainWindow ); } else if ( moi.majorVersionNumber == 4 ) { moi.ui.createDialog( 'moi://appdata/nodeeditor/index.html', 'resizeable,defaultWidth:680,defaultHeight:420', moi.ui.mainWindow ); }

Does the above code works by omitting the term "script:" ?

I think it does work with or without it!

EDITED: 6 May 2021 by DRILLBIT

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.898 In reply to 7713.896 
I took it from Pilou's page here: https://moiscript.weebly.com/install-elephant.html
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.899 
Is there a place in which people share their nodes? Or tutorials?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7713.900 In reply to 7713.897 
Hi Psygorn,

re:
> Is that it:

Yup, that is what it looks like when it's running. You can right click in there to start adding nodes.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7713.901 In reply to 7713.899 
<< Is there a place in which people share their nodes? Or tutorials?

You can find tones here! ;)

https://moi3d.com/forum/index.php?webtag=MOI&msg=7777.1
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.902 In reply to 7713.901 
Tanx PILOU :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.903 
Hello all,

Do we have Floor and ceiling functions in Math Node?

I mean this function: https://en.wikipedia.org/wiki/Floor_and_ceiling_functions
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
7713.904 In reply to 7713.903 
Psygorn,

Type into math node as shown


James
https://www.instagram.com/nodeology/
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.905 In reply to 7713.904 
Hello James,

Thank you for your reply,

Could you help me here:

Why does it seem that the floor function doesn't work properly?



I don't think for the value of A = 117 it should display -1!

How can I get 1 for values of A from 0 to 180, and -1 for values of A from 181 to 360?

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Barry-H
7713.906 In reply to 7713.905 
Hi,
try using the compare node.
Cheers
Barry


EDITED: 6 Apr 2022 by BARRY-H

Image Attachments:
Size: 74.1 KB, Downloaded: 28 times, Dimensions: 400x259px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
7713.907 In reply to 7713.905 
Psygorn,

quote:
Why does it seem that the floor function doesn't work properly?

It is working properly...given that sin(117) / 2 = -0.34, the floor value will be -1

quote:
How can I get 1 for values of A from 0 to 180, and -1 for values of A from 181 to 360?

Firstly, if working with degrees use square brackets : sin[a] because they convert degrees to radians
used by trigonometric functions.

If you imagine a point revolving around a circle, at any point the sine of the angle: sin[a]
equals the y component / radius, so regardless of the radius the result will be 0 on the horizontal axis
and 1 & -1 at top & bottom of the vertical axis respectively, and the points in-between will give a result
ranging from -1 to 1

There is a lot of better explanation of trigonometric functions online, here is the wikipedia page:
https://en.wikipedia.org/wiki/Sine_and_cosine

James
https://www.instagram.com/nodeology/

EDITED: 6 Apr 2022 by JFH

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.908 In reply to 7713.907 
>> It IS working properly...given that sin(117) / 2 = -0.34, the floor value will be -1

Hello James, but I think sin(117) = 0.891 even calculator says that!



I assume the value of sin is not calculated in Degree? (I think it is in Rad)

How can I get 1 for values of A from 0 to 180, and -1 for values of A from 181 to 360? in Degrees.
for example I thought if I use : 1+( 2 * floor function of (sin (a)/2)) I could have 1 for 0<a<180 and -1 for 180 <a<360

.>>If you imagine a point revolving around a circle, at any point the sine of the angle: sin[a]
equals the y component / radius, so regardless of the radius the result will be 0 on the horizontal axis
and 1 & -1 at top & bottom of the vertical axis respectively, and the points in-between will give a result
ranging from -1 to 1

Luckily, I know about it! and I know if we imagine a circle and divide it by the largest horizontal segment (it's horizontal diameter) then "sin(an angle in the upper semicircle)" would be positive and "sin(an angle in the lower semicircle)" would be negative. :-)

I just don't know how to do it in Nodeeditor, How to turn all positive values of sin to 1 and negative ones to -1.

Edit: Dear James I always had struggle where t use RAD and where to use Degree!

EDITED: 6 Apr 2022 by DRILLBIT

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7713.909 In reply to 7713.908 
The javascript sin(angle) gives the correct result for angle in radians.

For 117 degrees, multiply by (PI/180) yields 2.042... radians. Javascript sin(2.042...) = .891..., which agrees with your calculator set to DEG.

James is correct, in that javascript sin(117) treats 117 as radians, NOT degrees.

Max is using square brackets [ ] for the trig. The math in Max's node is done using Javascript Math functions. Javascript version ES5, NOT ES6.
(I think sin() is the same as sin[] in the node (???))

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7713.910 In reply to 7713.908 
Google search often yields responses on stackoverflow, which can be helpful, (if understandable)

See last answer here:
https://stackoverflow.com/questions/13975745/the-fastest-way-to-get-current-quadrant-of-an-angle

The degree angle theta needs to be converted to radians, to use the Javascript Math.sin[radianAngle]. (Max removed the need to use Math. in front of sin)

if sin[theta*PI/180] >= 0 , then output is +1.

if sin[theta*PI/180] < 0 , then output is -1.

So compare does seem to be useful. The Sine provides similar benefit to using modulus of +/- angle. Javascript Modulus (%), of angle could be used instead of Sine...

- Brian

EDITED: 6 Apr 2022 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Psygorn (DRILLBIT)
7713.911 In reply to 7713.909 
Thank you Brian,

Now, I got it!

:)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Psygorn (DRILLBIT)
7713.912 In reply to 7713.910 
Thank you again, Brian,

Your explanation helped a lot!

I was able to solve the problem and here are the results:

http://moi3d.com/forum/index.php?webtag=MOI&msg=10641.16

I would be happy to know your opinion about it! (I mean could I do it better?)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-13  …  834-853  854-873  874-893  894-912