Last active
December 14, 2023 16:39
-
-
Save m13253/4a9d5b5d3dd4e7050f87 to your computer and use it in GitHub Desktop.
wxMaxima document of https://github.com/m13253/danmaku2ass/issues/7#issuecomment-44860472
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ | |
| /* [ Created with wxMaxima version 13.04.2 ] */ | |
| /* [wxMaxima: input start ] */ | |
| FlashRot:matrix( | |
| [ cos(rotY)*cos(rotZ), cos(rotY)*sin(rotZ), sin(rotY), 0], | |
| [-sin(rotZ), cos(rotZ), 0, 0], | |
| [-sin(rotY)*cos(rotZ), -sin(rotY)*sin(rotZ), cos(rotY), 0 ], | |
| [trX, trY, 0, 1]); | |
| /* [wxMaxima: input end ] */ | |
| /* [wxMaxima: input start ] */ | |
| ASSRot:( | |
| matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[trx-W/2,try-H/2,1,1]) | |
| . | |
| matrix([cos(z),-sin(z),0,0],[sin(z),cos(z),0,0],[0,0,1,0],[0,0,0,1]) | |
| . | |
| matrix([1,0,0,0],[0,cos(x),sin(x),0],[0,-sin(x),cos(x),0],[0,0,0,1]) | |
| . | |
| matrix([cos(y),0,-sin(y),0],[0,1,0,0],[sin(y),0,cos(y),0],[0,0,0,1]) | |
| . | |
| matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[W/2,H/2,trz,1]) | |
| ); | |
| /* [wxMaxima: input end ] */ | |
| /* [wxMaxima: input start ] */ | |
| ( | |
| matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[trx-W/2,try-H/2,1,1]) | |
| . | |
| matrix([cos(rotY)*cos(rotZ),cos(rotY)*sin(rotZ),sin(rotY),0],[−sin(rotZ),cos(rotZ),0,0],[−sin(rotY)*cos(rotZ),−sin(rotY)*sin(rotZ),cos(rotY),0],[0,0,0,1]) | |
| . | |
| matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[W/2,H/2,trz,1]) | |
| ); | |
| /* [wxMaxima: input end ] */ | |
| /* [wxMaxima: input start ] */ | |
| solve([W/2+cos(rotY)*cos(rotZ)*(trx−W/2)−(try−H/2)*sin(rotZ)−sin(rotY)*cos(rotZ)=trX, cos(rotY)*sin(rotZ)*(trx−W/2)−sin(rotY)*sin(rotZ)+(try−H/2)*cos(rotZ)+H/2=trY, sin(rotY)*(trx−W/2)+cos(rotY)+trz=0], [trx, try, trz]); | |
| /* [wxMaxima: input end ] */ | |
| /* [wxMaxima: input start ] */ | |
| trigsimp(%); | |
| /* [wxMaxima: input end ] */ | |
| /* [wxMaxima: input start ] */ | |
| matrix([trx=−((cos(rotZ)−cos(rotY))*W−2*sin(rotZ)*trY−2*cos(rotZ)*trX+H*sin(rotZ)−2*sin(rotY))/(2*cos(rotY))],[try= | |
| (sin(rotZ)*W+2*cos(rotZ)*trY−2*sin(rotZ)*trX−H*cos(rotZ)+H)/2],[trz= | |
| (sin(rotY)*cos(rotZ)*W−2*sin(rotY)*sin(rotZ)*trY−2*sin(rotY)*cos(rotZ)*trX+H*sin(rotY)*sin(rotZ)−2)/(2*cos(rotY))], [scalez=FOV/('trz+FOV)]); | |
| /* [wxMaxima: input end ] */ | |
| /* Maxima can't load/batch files which end with a comment! */ | |
| "Created with wxMaxima"$ |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
14行有误,应改成
matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[trx-W/2,try-H/2,0,1])。