I am working on a web project where I have a car moving on the canvas, and I need to get the colors of the pixels in front of the car.(我正在一个Web项目中工作,有一辆汽车在画布上移动,我需要获取汽车前部像素的颜色。)
I know how to get their colors, but have problems with their coordinates because my car's angle of moving is changing.(我知道如何获得它们的颜色,但是它们的坐标存在问题,因为我的汽车的移动角度正在变化。) Can I somehow dynamically calculate their coordinates knowing the center point of the car and its angle rotation?(我能否以某种方式知道汽车的中心点及其角度旋转来动态地计算其坐标?)
ask by BlackFlameLord translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…