You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letmycam,lastCam,initialCam;letcountForReset=30;// This sample uses orbitControl() to move the camera.// Double-clicking the canvas restores the camera to its initial state.functionsetup(){createCanvas(400,400,WEBGL);strokeWeight(3);mycam=createCamera();// main cameralastCam=createCamera();// Camera for recording loc info before resetinitialCam=createCamera();// Camera for recording the initial statesetCamera(mycam);// set main camera}functiondraw(){if(countForReset<30){// if the reset count is less than 30,// it will move closer to the original camera as it increases.countForReset++;mycam.slerp(lastCam,initialCam,countForReset/30);}else{// if the count is 30,// you can freely move the main camera with orbitControl().orbitControl();}background(255);box(160);}// A double-click sets countForReset to 0 and initiates a reset.functiondoubleClicked(){if(countForReset===30){countForReset=0;lastCam.set(mycam);}}
2023-10-29.22-00-05.mp4
In addition, we have confirmed that slerp behaves strangely in some sketches.
I know the cause. #6287
This is because the specifications of row() and column() were changed in this commit, calling it a bug.
I was the one who created this specification, but from the perspective of looking at the elements of a matrix from left to right, this is not a bug.
However,
It no longer matters what is a bug or what is not. I'm tired of repeating pointless discussions about it.
I have no connection with the circumstances or validity of this specification change, and I have no interest in it.
This problem has already been resolved, so I'll just state my conclusion, and create a pull request, and solve it. That's it.
// BUG IS HERE.varfront0=rotMat0.column(2);varfront1=rotMat1.column(2);varup0=rotMat0.column(1);varup1=rotMat1.column(1);
// FIX THE BUG// The specifications of column() and row() have been reversed, so column() must be rewritten as row().varfront0=rotMat0.row(2);varfront1=rotMat1.row(2);varup0=rotMat0.row(1);varup1=rotMat1.row(1);// prepare new vectors.
2023-10-29.22-10-43.mp4
That's all.
It may affect unit tests, but since this behavior is correct, it makes sense to adapt to it.
The text was updated successfully, but these errors were encountered:
Most appropriate sub-area of p5.js?
p5.js version
1.8.0
Web browser and version
Chrome
Operating System
Windows11
Steps to reproduce this
Steps:
Snippet:
SLERP_BUG
2023-10-29.22-00-05.mp4
In addition, we have confirmed that slerp behaves strangely in some sketches.
I know the cause.
#6287
This is because the specifications of row() and column() were changed in this commit, calling it a bug.
I was the one who created this specification, but from the perspective of looking at the elements of a matrix from left to right, this is not a bug.
However,
It no longer matters what is a bug or what is not. I'm tired of repeating pointless discussions about it.
I have no connection with the circumstances or validity of this specification change, and I have no interest in it.
This problem has already been resolved, so I'll just state my conclusion, and create a pull request, and solve it. That's it.
CAMERA_SLERP_BUG
2023-10-29.22-10-43.mp4
That's all.
It may affect unit tests, but since this behavior is correct, it makes sense to adapt to it.
The text was updated successfully, but these errors were encountered: