In the last version I improved the 3D plot shading and added some nice 3D effects. Bellow is the plot of the function

`f`(`x`; `y`) = **cos**(`x`) + **cos**(`y`) + **cos**(`x`·`y`/3)/2 + **cos**(√(`x`^{2} + `y`^{2})·2)/2

with the “Rainbow” color scale and the “Shadows” option on:

What is new is the specular light effect (the little shiny reflections). I also replaced the Gouraud shading procedure with the Phong one. It improved the image quality without any noticeable impact on the speed (surprisingly). Since the light is distant and the view is isometric, I use the Blinn–Phong shading model. Instead of calculating the reflection vector for each vertex, it calculates the halfway vector between the viewer and light-source. It is performed once for the whole model, and that is why it is faster.

In general, there is additional overhead for generating the Html output, converting the image to base64 and rendering the Html into the “Output” window. However, as long as it takes much less than a second for all of it, the speed is not of a big concern.

### Like this:

Like Loading...

*Related*