Smooth rotations

Raylectron (https://Raylectron.com) is a 3D rendering engine for Trimble Sketchup (https://sketchup.com)
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

Don't worry about my sig, I can live without it and you have better things to spend time on. I do appreciate that you want to make me a sig, I really do <3

That's a nice and smooth animation <3 :salute
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

It will be some simple but meaningful words I think :mrgreen:

Yes it was, but why didn't it do the second part? I used the same code.
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

Maybe it's because you didn't set the Length of the video to match? What was the code you use?
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

I think you're right. I forget the video length :lol:

This one.

Code: Select all

Roll(360,1,10);
Yaw(360,11,29);
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

Right, the Yaw ends at 29, so make your video length 30 to give it an extra second after it stops before the video end.
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

Yep, I did that and it came out rather well. But I wanted to add something special, not sure what. Any suggestions?
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

You could add an asset, the Asteroid rock, have a few hundred of them in a small box ahead of the ship, then set the script for it to rx := 1; and they'll all go in all direction as if the ship had fired on the stack. I don't know! :mrgreen:
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

Hmmm, that might work. Although my asteroids were always a bit iffy :lol:
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

The asset contains an Asteroid rock, really nice too.
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

Yes I've played around with that and most likely I'll add that to a 'whole' project I have in mind. I need to get back to my airfield animation and finish it, to where the 302 takes off and disappears into the atmosphere.

Vid 2 will be when it enters space, encounters some asteroids and finally I'll show it off when the spin video :mrgreen:
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

I can't wait to see that. Do you think your laptop can handle it?
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

Slowly, but yes. What I need help with is where do we go from the end of the older coding? How do we finish it and do we need to change it to the new format?

Code: Select all

Units := Meters;

BlinkLight('emitter_blue_tailight', 2, 0, 999);
BlinkLight('emitter_stb_nav',       3, 0, 999);
BlinkLight('emitter_port_nav',      3, 0, 999);
BlinkLight('emitter_nav_light',     1, 0, 999);

Accelerate(py, 40, 2, 27);

DistDecelerate(py, 25, 27);

Yaw(-90, 30, 40);

Accelerate(py, 30, 42, 43);

if (sec >= 40) and (sec <= 42) then 
  CamRotX := -12/(2*fps);

if (sec >= 42) and (sec <= 52) then 
  CamPosY := py / 1.3;

Pitch(35, 46, 49);

if (sec >= 46) and (sec <= 49) then 
  CamRotX := -10/(3*fps);
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

If that code works, then there is no need to change the format. All we need to know is what you need it to do at the end.
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

From where it stops after turning the corner, it rests for say 3-4 seconds, then slowly starts to roll forward, building speed for about 250m, before a 20-25 degree lift off, then start to arc to almost vertical and disappear off screen (at which point in the sound track I'll add a sonic boom!) :mrgreen:
takeoff.jpg
takeoff.jpg (82.77 KiB) Viewed 57618 times
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

But that's what the script do already, third line from last...

Pitch(35, 46, 49);
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

I'll try it and see what happens then. :salute
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

:salute
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

error 9.26 'invalid number of parameters'
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

What's the script you use?
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

The one I posted earlier today in this thread.

Units := Meters;

BlinkLight('emitter_blue_tailight', 2, 0, 999);
BlinkLight('emitter_stb_nav', 3, 0, 999);
BlinkLight('emitter_port_nav', 3, 0, 999);
BlinkLight('emitter_nav_light', 1, 0, 999);

Accelerate(py, 40, 2, 27);

DistDecelerate(py, 25, 27);

Yaw(-90, 30, 40);

Accelerate(py, 30, 42, 43);

if (sec >= 40) and (sec <= 42) then
CamRotX := -12/(2*fps);

if (sec >= 42) and (sec <= 52) then
CamPosY := py / 1.3;

Pitch(35, 46, 49);

if (sec >= 46) and (sec <= 49) then
CamRotX := -10/(3*fps);
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

you must be using an older rbz, trye this one...

https://raylectron.com/files/Raylectron.rbz
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

That was the last one you sent me?
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

It was a while back so to make sure, use the one I just sent you, I just compiled it and tested the script and it all works.
Your support team.
https://SoftByteLabs.com
User avatar
GateGirl86
Posts: 845
Joined: Mon Oct 03, 2022 8:32 pm

Re: Smooth rotations

Post by GateGirl86 »

working but the 302 is going backwards, which figure do I change to correct that? Y, Z or something?
Image
"Come with me if you want to live."
Sarah Connor
User avatar
Support
Site Admin
Posts: 3004
Joined: Sun Oct 02, 2011 10:49 am

Re: Smooth rotations

Post by Support »

no, just make it negative, at the end of the script, add py := -py; and that will reverse the direction.
Your support team.
https://SoftByteLabs.com
Post Reply