📜 ⬆️ ⬇️

New Year's IT ball



Happy New Year everyone!

I am the author of iPixelSDK and also join the New Year demostsen.
')
Video and more about the process of creating a ball under the cut.



Device: iPad
Engine: Cocos2d 2.0
Development environment: iPad iPixelSDK 1.0

The development process on the iPad is as follows:

The ball consists of 4 functions and 2 shaders.

201000: 20. Stars (radial) Ball control function. Initializes the object, calls the move function, enables the draw function and shaders.



201010: 20.0. # Draw (radial) The drawing function. Draws a vertex array.



201020: 20.0. # Init_stars (radial) Initialization of the ball, sets the number of points, color and position of each point in the spherical coordinate system.



201030: 20.0. # Move_stars (radial) Moving points, rotating along xz, xy axes.



201100: S: 20.0. ^ Starfield.vsh (radial) Vertex shader, sets the size of points, converts the spherical coordinates into three-dimensional Cartesian, and then into two-dimensional (because cocos2d 2d-engine).



201101: S: 20.0. ^ Starfield.fsh (radial) A pixel shader that draws a highlight.



Thanks for attention. Waiting for your comments.

Source: https://habr.com/ru/post/164501/


All Articles