Table of Contents
回复内容:
Home Web Front-end H5 Tutorial CSS transform中rotate能不能实现以对角线为轴进行旋转?

CSS transform中rotate能不能实现以对角线为轴进行旋转?

Jun 07, 2016 am 08:43 AM
origin rotate transform

如图中名为in的div,用rotate以AD为轴进行“斜的旋转”可以实现吗?
我进行的尝试,transform-origin属性好像只能将坐标轴进行偏移但没办法令其旋转,所以旋转的轴都是水平或者垂直的...rotateX()和rotateY()的搭配也不太可行...
要怎么样才能实现这种旋转?

回复内容:

谢邀,
你的需求和origin并没有直接的关系。
就在你当前页改的哦:
CSS transform中rotate能不能实现以对角线为轴进行旋转?
结果:
CSS transform中rotate能不能实现以对角线为轴进行旋转?前三个是(x,y,z)矢量坐标, 第四个是角度

而且,既然transform是支持matrix函数的,理论上是可以应用任意三维变换的,同学你思维不用停留在css提供的便利函数。

你甚至也可以不使用transform而使用别的css属性配合矩阵运算来实现3d,就更灵活了,安利下之前做的DEMO
GitHub - leeluolee/clip3d: 3D rendering with css:clip-path


当然实用性目前接近0 谢邀
用rotate3d(1,1,0,xxdeg) xx是角度值 对于这种情形,你应该使用 matrix3d 做矩阵变化的运算
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to download Origin on Windows 11 How to download Origin on Windows 11 Apr 14, 2023 pm 02:01 PM

What does Origin do? Origin is the platform you need to be able to play most Electronic Arts games on a Windows 11 PC. The platform has been around for a long time and it offers a variety of other games that you can buy and play. But it also has other useful features, such as the ability to chat with friends and earn achievements for the games you play. Definitely worth a try. Along with Steam and Epic Games, it's one of the many game launchers your Windows computer can access. EA Play is the solution for those who want to have a large selection of different games to choose from and enjoy them without having to purchase each one. Nature

How to use CSS to achieve the rotating background animation effect of elements How to use CSS to achieve the rotating background animation effect of elements Nov 21, 2023 am 09:05 AM

How to use CSS to implement rotating background image animation effects of elements. Background image animation effects can increase the visual appeal and user experience of web pages. This article will introduce how to use CSS to achieve the rotating background animation effect of elements, and provide specific code examples. First, we need to prepare a background image, which can be any picture you like, such as a picture of the sun or an electric fan. Save the image and name it "bg.png". Next, create an HTML file and add a div element in the file, setting it to

How to crop and rotate images in Vue? How to crop and rotate images in Vue? Aug 19, 2023 am 08:01 AM

How to crop and rotate images in Vue? Overview: In Vue development, we often encounter the need to crop and rotate images. This article will introduce how to use Vue and related plug-ins to implement image cropping and rotation functions, and comes with code examples. Preparation: Before starting, we need to install and introduce the following two plug-ins: vue-cropper: a Vue-based image cropping plug-in that can be used to perform operations such as cropping and rotating images. vue-rotate: a Vue directive, used

How to compress and format images in Vue? How to compress and format images in Vue? Aug 25, 2023 pm 11:06 PM

How to compress and format images in Vue? In front-end development, we often encounter the need to compress and format images. Especially in mobile development, in order to improve page loading speed and save user traffic, it is critical to compress and format images. In the Vue framework, we can use some tool libraries to compress and format images. Compression using the compressor.js library compressor.js is a JavaS for compressing images

Interpretation of CSS 3D view properties: transform and perspective Interpretation of CSS 3D view properties: transform and perspective Oct 24, 2023 am 08:11 AM

Interpretation of CSS3D view properties: transform and perspective, specific code examples are required Introduction: In modern web design, 3D effects have become a very popular element. Through the transform and perspective properties of CSS, we can easily add 3D visual effects to web pages to make them more vivid and attractive. This article will explain these two properties and provide specific code examples. 1. transform attribute: transf

How to implement image animation and gradient effects in Vue? How to implement image animation and gradient effects in Vue? Aug 18, 2023 pm 06:00 PM

How to implement image animation and gradient effects in Vue? Vue is a progressive framework for building user interfaces that makes it easy to implement animations and gradient effects. In this article, we will introduce how to use Vue to implement image animation and gradient effects, and provide some code examples. 1. Use Vue’s transition effects to implement image animation. Vue provides built-in instructions for transition effects, making it easy to add animation effects to HTML elements. When using transition effects, you can wrap picture elements and add transition instructions on the elements. Example

Exploring CSS rotation properties: transform and rotate Exploring CSS rotation properties: transform and rotate Oct 21, 2023 am 09:46 AM

Exploration of CSS rotation properties: transform and rotate Introduction: In modern web design, we often need to add some special effects to elements to increase the attractiveness and user experience of the page. Among them, the rotation of elements is a common effect that can help us create unique visual effects. In CSS, we can use the transform attribute and its rotation attribute rotate to achieve the rotation of the element. This article explores the use of these two properties and provides code

Detailed explanation of CSS circular layout properties: border-radius and transform Detailed explanation of CSS circular layout properties: border-radius and transform Oct 21, 2023 am 11:46 AM

Detailed explanation of CSS circular layout properties: border-radius and transform 1. Introduction In web design, circular layout is often used to create circular elements, such as buttons, avatars, etc. The two key CSS properties for implementing a circular layout are border-radius and transform. This article will introduce in detail how to use the border-radius and transform properties to create a ring layout, and provide specific code examples. 2. border-ra

See all articles