Lerp is not so good at rotation

Get help using Construct 2

Post » Fri Jan 13, 2012 6:52 pm

hello guys
i tried this many times but i did not get it to work
Lerp with angles
What i wanna do :
Make the object rotate smoothly like a plane rotation
More presisely...
Make it rotate with lerp 30 degrees at right when the mouse cursor is at the right
Make it rotate back to 0 if cursor is over object
Make it rotate with lerp 30 degrees at left when the mouse cursor is at the left
And..
Make it rotate like a plane from left or right
and vice versa ..
Like this
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Jan 13, 2012 7:58 pm

Any help ?
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Jan 13, 2012 8:06 pm

Your right in the sense lerp is not so good at rotation, as yann pointed out to me a while ago its not going to be easy using lerp.

He helped me get it working with my project.

So let me know exactly how you need the rotation working and i'll help you get started..

Provide a simple capx of your attempt please
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Fri Jan 13, 2012 8:13 pm

Yay @Yann is online :)
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Jan 13, 2012 8:28 pm

Your answer: Emulate anglelerp.

Also your example is in 3D. It doesn't show/help to see what you're wanting to do.
Are you doing perspective or something ?Kyatric2012-01-13 20:29:53
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Jan 13, 2012 8:31 pm

@Kyatric

I will really do a 3d game
also i dont understand yann example
can you edit my capx?kbdmaster2012-01-13 20:33:50
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Jan 13, 2012 8:43 pm

Check your inbox, i sent the capx back hopefully its what you wanted.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Fri Jan 13, 2012 9:02 pm

@smitchell
Thank you
But its not what i want 100%
(fixed it up but there are more bugs)
Bugs:
1-The spaceship don't follow the mouse
2-When the spaceship is fully rotated you can see it struggle

http://dl.dropbox.com/u/46771759/Not%20working.capx
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Jan 13, 2012 9:06 pm

Sure I can fix that.

But the capx gives me a error something about animation, try upload it again
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Fri Jan 13, 2012 9:15 pm

B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Next

Return to How do I....?

Who is online

Users browsing this forum: kingpirux and 6 guests