![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi, just started using megapov and have a few questions due to some
unexpected results of trying out "slope".
1. If I have "slope y", is the following correct?
normal vector < 0, -1, 0 > returns 0.0
normal vector < 1, 0, 0 > returns 0.5
normal vector < -1, 0, 0 > returns 0.5
normal vector < 0, 0, 1 > returns 0.5
normal vector < 1, 0, 1 > returns 0.5
normal vector < 1, 1, 1 > returns 0.75 (?)
2. Is there a formula for calculating the return from any particular normal
for a specified slope value?
3. Since scaling an object unevenly will modify surface normals, presumably
slope y pigments are affected by whether they are before or after such
scaling?
Many thanks.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi Tom,
Tom Melly wrote:
>
> Hi, just started using megapov and have a few questions due to some
> unexpected results of trying out "slope".
>
> 1. If I have "slope y", is the following correct?
> normal vector < 0, -1, 0 > returns 0.0
> normal vector < 1, 0, 0 > returns 0.5
> normal vector < -1, 0, 0 > returns 0.5
> normal vector < 0, 0, 1 > returns 0.5
> normal vector < 1, 0, 1 > returns 0.5
> normal vector < 1, 1, 1 > returns 0.75 (?)
Yes, except the last one which yields ~0.85 ( (1/sqrt(2) + 1) * 0.5 ).
And <0, 1, 0> would return 1.0.
>
> 2. Is there a formula for calculating the return from any particular normal
> for a specified slope value?
It's the dot product of the normal vector and the normal specified
in the slope statement (in your example <0, 1, 0>) plus 1.0 divided
by two: (vnormal.slopevect + 1.0 ) * 0.5.
(Note: the result is not proportional to the included angle.)
This holds only for the simple slope statements (slope <vector>).
For the other variants the formula is more complex, you may
want to have a look at the docs for that.
>
> 3. Since scaling an object unevenly will modify surface normals, presumably
> slope y pigments are affected by whether they are before or after such
> scaling?
Can't comment on this as I'm not familiar with the other
modifications in megapov. But a simple test scene (sphere
scaled in y direction) should do.
Hans
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hans-Detlev Fink wrote:
>
> Hi Tom,
>
> Tom Melly wrote:
> >
> > Hi, just started using megapov and have a few questions due to some
> > unexpected results of trying out "slope".
> >
> > 1. If I have "slope y", is the following correct?
> > normal vector < 0, -1, 0 > returns 0.0
> > normal vector < 1, 0, 0 > returns 0.5
> > normal vector < -1, 0, 0 > returns 0.5
> > normal vector < 0, 0, 1 > returns 0.5
> > normal vector < 1, 0, 1 > returns 0.5
> > normal vector < 1, 1, 1 > returns 0.75 (?)
>
> Yes, except the last one which yields ~0.85 ( (1/sqrt(2) + 1) * 0.5 ).
Which of course should read "... ~0.79 ( (1/sqrt(3) + 1) * 0.5 )".
Too bad I use to think in 2 dimensions only ;-)
Hans
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |