Jump to content

Material file question (.obj export)


bmikiwer

Recommended Posts

I'm trying to make sense of the 'Ns' values I get when exporting a model(.obj) from IronCAD.

 

11 Cylinders, Highlight spread from 0 - 100 (0, 10, 20, 30, ...) gets me a .mtl file with these 'Ns' values:

 

5, 21, 69, 149, 261, 405, 581, 789, 1029, 1301, 1605

 

 

I've read that the 'Ns' values usually are between 0 and 1000.

First I thought these values were exponential but I believe them to be quadratic.

 

Is there a mathematic function that will convert these values to linear values between 0 - 100 or 0 - 1000?

 

Example:

If a material get's a 'Ns' value of 681 how would I know how much Highlight Spread that material has?

Edited by bmikiwer
Link to comment
Share on other sites

Here's the info I received from the developer:

 

Here is the formula they can use to convert IC Ns to 0 to 100

 

If( value

                Ns = 0;

Else if (value > 1605 )

                Ns = 100;

Else

{

                Ns = sqrt(a-5) * 2.5;

]

44622[/snapback]

 

Thank you!

 

Just wanted to point out that in your "Else" statement, it should be:

Ns = sqrt(value-5) * 2.5;

if I'm not mistaken.

 

But it appears to be working perfectly. I did modify this a bit since I need the values between 0 and 1 and in reverse. This function is written in Python if anyone is wondering.

 

def ironNs(value):

----if value

--------ns = 1.0

----elif value > 1605.0:

--------ns = 0.0

----else:

--------ns = 1.0 - (sqrt(value - 5) * 0.025)

----return ns

 

Also, thank the developer!

Edited by bmikiwer
Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...