Smooth rotations
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
It works fine on the same model that you sent me like a week ago but not on this one. So it seems like the component axis has changed in Sketchup, when you modified the model? In Sketchup, right click the 302 and select Change Axis to make sure it's at the right place and the axis are aligned correctly, sitting in the cockpit, red pointing right, green pointing forward and blue pointing up.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
Hmm, yes that could have been the issue. I've re-orientated the model now, so we'll see how we go.
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
A few issues. But it's a great start. I'll let you see what we can change to fix it
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
Looks good, just the turning left is a bit too late and the stop is too early, and maybe the takeoff is too soon, but that's all about changing the seconds in the functions.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Smooth rotations
BTW, after you have reset the orientation in Sketchup, did you remove py := -py; from the script?
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
I do need to work out in my head the timing (seconds). I did remove the py yes.
After the take off, you'll notice when it goes up, rather than increase the angle of flight, it tends to flatten out, instead of upwards.
After the take off, you'll notice when it goes up, rather than increase the angle of flight, it tends to flatten out, instead of upwards.
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
Yes it looks that way, but I think it's because of the viewing angle of the camera. I'm not sure but I'll check it out by placing the camera elsewhere...brb
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Smooth rotations
I can't test this properly because I only have the model with the wrong axis.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
It's working fine, it stays at that angle until the video ends. So it's a camera angle view thing. Beside, it's only a 30 deg climb.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
how do I change the camera angle? And increase the last angle to 50 degrees? I'd like to also have it sit there for 10 seconds before it starts the take off. Can we do that?
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
Yes, you can do all that, it's just the timing and distances that you have to set. Follow the code and adjust to what you want.
After all the blinking commands, you have...
Accelerate(py, 40, 2, 27);
which makes the 302 accelerate for a distance of 40 meters from 2 seconds to 27 seconds. But then, you have...
DistDecelerate(py, 25, 27);
which makes it decelerate to a stop for a distance of 25 meters and to do it starting at 27 seconds.
The comes the left turn...
Yaw(-90, 30, 40);
90 deg total and it starts to turn at 30 seconds and will stop turning at 40 sec.
Then 2 seconds later, at 42 seconds, you have...
Accelerate(py, 30, 42, 43);
which will make it accelerate 30 meters in 2 seconds and stay at that speed.
Then at 46 seconds, it nose up 35 degree in 3 sec and then stays at the angle.
Pitch(35, 46, 49);
So just change the timing of the events.
After all the blinking commands, you have...
Accelerate(py, 40, 2, 27);
which makes the 302 accelerate for a distance of 40 meters from 2 seconds to 27 seconds. But then, you have...
DistDecelerate(py, 25, 27);
which makes it decelerate to a stop for a distance of 25 meters and to do it starting at 27 seconds.
The comes the left turn...
Yaw(-90, 30, 40);
90 deg total and it starts to turn at 30 seconds and will stop turning at 40 sec.
Then 2 seconds later, at 42 seconds, you have...
Accelerate(py, 30, 42, 43);
which will make it accelerate 30 meters in 2 seconds and stay at that speed.
Then at 46 seconds, it nose up 35 degree in 3 sec and then stays at the angle.
Pitch(35, 46, 49);
So just change the timing of the events.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
I can follow that
Yaw(-90, 30, 40);
90 deg total and it starts to turn at 30 seconds and will stop turning at 40 sec.
Then 2 seconds later, at 42 seconds, you have...
Accelerate(py, 30, 42, 43);
To make it sit there longer. Could I change 42 to 52?
then in the climb
Then at 46 seconds, it nose up 35 degree in 3 sec and then stays at the angle.
Pitch(35, 46, 49); how would I add a change to 50 deg after a few moments? (say 3 seconds at 35 deg)
Yaw(-90, 30, 40);
90 deg total and it starts to turn at 30 seconds and will stop turning at 40 sec.
Then 2 seconds later, at 42 seconds, you have...
Accelerate(py, 30, 42, 43);
To make it sit there longer. Could I change 42 to 52?
then in the climb
Then at 46 seconds, it nose up 35 degree in 3 sec and then stays at the angle.
Pitch(35, 46, 49); how would I add a change to 50 deg after a few moments? (say 3 seconds at 35 deg)
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
no because that's the "start at" and 52 is the "end at" and that's the acceleration.GateGirl86 wrote: Thu May 25, 2023 3:47 pm Accelerate(py, 30, 42, 43);
To make it sit there longer. Could I change 42 to 52?
//Then 2 seconds later, at 42 seconds, you have...
//Accelerate(py, 30, 42, 43);
That's the part where it sits for 2 seconds before accelerating again, so if you want it to sit there for an additional 8 seconds, you need to add 8 to the 42 and 43. Then any other functions after that, also need to be adjusted by adding that 8 extra seconds to Pitch(35, 46, 49); as well, so that would be Pitch(35, 46+8, 49+8);
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
Got it!
after the pitch, could I add.
Pitch(50, 62, 68);
after the pitch, could I add.
Pitch(50, 62, 68);
"Come with me if you want to live."
Sarah Connor
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
*fail* I know I shouldn't get emotional over these things, but I do. I hate failure. I totally screwed this one up???
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
You did just fine , you only forgot to update the timing in this one...
if (sec >= 48.0) and (sec <= 48.0) then
CamRotX := -12.0/(2.0*fps);
make that 58,78 or whatever instead of 58, 58
This line takes care of orienting the camera up before making it go forward because it's pointing downward and moving it forward will follow to downward path.
if (sec >= 48.0) and (sec <= 48.0) then
CamRotX := -12.0/(2.0*fps);
make that 58,78 or whatever instead of 58, 58
This line takes care of orienting the camera up before making it go forward because it's pointing downward and moving it forward will follow to downward path.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Smooth rotations
I've changed a few numbers because the Yaw was happening while the 302 was not really moving and lowered the value for the camera looking up. Also, you should change the axis of the 302 to be in the middle of the 2 back wheels so it looks realistic when it turns on the runway.
Code: Select all
Units := Meters;
BlinkLight('emitter_blue_tailight', 1.0, 0.0, 999.0);
BlinkLight('emitter_stb_nav', 1.0, 0.0, 999.0);
BlinkLight('emitter_port_nav', 1.0, 0.0, 999.0);
BlinkLight('emitter_nav_light', 1.0, 0.0, 999.0);
Accelerate(py, 35.0, 2.0, 35.0);
DistDecelerate(py, 35.0, 48.0);
Yaw(-90.0, 35.0, 45.0);
Accelerate(py, 30.0, 58.0, 59.0);
if (sec >= 58.0) and (sec <= 78.0) then
CamRotX := -8.0/(2.0*fps);
if (sec >= 58.0) and (sec <= 68.0) then
CamPosY := py / 1.3;
Pitch(35.0, 62.0, 63.0);
if (sec >= 62.0) and (sec <= 63.0) then
CamRotX := 0.0/(3.0*fps);
Pitch(50.0, 68.0, 69.0);
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
- GateGirl86
- Posts: 845
- Joined: Mon Oct 03, 2022 8:32 pm
Re: Smooth rotations
Almost got it!!!!
It just disappears for a moment to the left of screen and doesn't quite leave the frame, instead just vanishes in mid air (might have got taken by the Asgard)
It just disappears for a moment to the left of screen and doesn't quite leave the frame, instead just vanishes in mid air (might have got taken by the Asgard)
"Come with me if you want to live."
Sarah Connor
Re: Smooth rotations
oh that's nice
and to rotate the camera to see more the left, the end of the script, you have something like this...
if (sec >= 62.0) and (sec <= 63.0) then
CamRotY := 1.0/(3.0*fps);
but it's CamRotX := 0.0/(3.0*fps);
so if you use that one instead and tuned it, it's going to be awesome, well Done "Sam"
and to rotate the camera to see more the left, the end of the script, you have something like this...
if (sec >= 62.0) and (sec <= 63.0) then
CamRotY := 1.0/(3.0*fps);
but it's CamRotX := 0.0/(3.0*fps);
so if you use that one instead and tuned it, it's going to be awesome, well Done "Sam"
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com