Home > Web Front-end > JS Tutorial > body text

Three-dimensional cube implemented in javascript (compatible with ie7, ff)_image special effects

WBOY
Release: 2016-05-16 19:06:10
Original
1235 people have browsed it

Record the rotation by updating the transformation matrix (function remx()).
Use the matrix to calculate the coordinates of the rotated cube vertices,
Convert the spatial coordinates of each vertex into plane coordinates according to "near large, far small" (function p2d()),
Use the z coordinate of the normal vector of each face of the cube to determine whether the face is visible,
Use a div layer with a height of 1px to simulate drawing a quadrilateral (function gra2htm()).
Drag the mouse The code is modified with someone else’s code.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template