In the 6th chapter, we talked about giving wooden texture to the object. Today, let us see how to give reflection to surfaces in JavaFX 3D. JavaFX provides option to specify specular maps as either image or a color.
Specular Map
Specular maps allows to define a surface’s shininess and highlight colour. The higher the value of a pixel (from black to white), the shinier the surface will appear. Black provides zero reflection and white provides total reflection.
If you want the surface to be having uniform reflection, then use a specular color with Material#setSpecularColor(Color color). Or use Material#setSpecularImage(Image image).
Let’s have a look at the example code.
private Box prepareBox() { PhongMaterial material = new PhongMaterial(); //Set diffuse map material.setDiffuseMap(new Image(getClass().getResourceAsStream("/resources/wood.jpg"))); //Set specular map material.setSpecularMap(new Image(getClass().getResourceAsStream("/resources/illuminati.jpg"))); Box box = new Box(100, 20, 50); box.setMaterial(material); return box; }
and the result will be
Visit JavaFX 3D Course Index Page
Meta titles: JavaFX Reflection, JavaFX 3D Specular Map
… [Trackback]
[…] Find More here to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Info to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More here on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Information to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More here on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] There you can find 64635 additional Information on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More Information here on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Info to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More on on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More here on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] There you will find 89292 more Information on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More here on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More here to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More on on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Info to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More on on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Info to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Read More on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Find More on that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]
… [Trackback]
[…] Information to that Topic: genuinecoder.com/javafx-3d-tutorial-7-reflection-with-specular-map/ […]