![]() ![]() The grapher3d() function contains the equation of the 3D surface. ![]() Here is the vertex shader used by all demos. You can also use GLSL Hacker as an interactive 3D surface editor by editing the vertex shader with the live-coding tool:Īs usual, the different GLSL shaders are not specific to GLSL Hacker and can be used in any OpenGL application. The hslToRgb() function allows to create the cool color transition according to the vertex height. I adapted this routine in Javascript in GLSL. The vertex shader also contains a function to convert a HSL color to a RGB color. The demos have been created with GLSL Hacker (Windows / OS X / Linux) and source codes (Lua + GLSL) are available in the 3D_Surface_Plots/ folder of the Code Sample Pack. ![]() The following demos are all based on a 100×100-vertex mesh grid that is deformed by a GLSL vertex shader according to the 3D surface equation. Here are some equations that allows you to compute surfaces in the 3D space following the general relation: z = f(x, y) or in the case of an OpenGL 3D space (GLSL Hacker for example), y = f(x, z). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |