Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Dez

Loco Automation

Recommended Posts

Hi all,
Back again, with more loco automation problems.
I thought, after all the brilliant assistance I had last time I posted, I would have no problem creating this animation.
How wrong I was.
Any help would be appreciated. I think my problems are obvious.
Thanks you

See the Pen ZEpYjyK by spring99 (@spring99) on CodePen

Link to post
Share on other sites

Hey @Dez

 

One probelm I see, is that you are using an enclosed path as the circle path for your circle (don't know how else to say this)

That is way your piston-link rotates one way, than the other instead of infinitely rotating in the same direction with the wheel.

If you for example set stroke to none and fill to a color on that path, you can see that the path you are mentioning is an enclosed shape.

 

I exchanged that with a single-stroke path instead and that problem is out of the way.

 

See the Pen zYKxJoy by akapowl (@akapowl) on CodePen

 

 

 

It is rotating in the wrong direction though.

 

I just grabbed some random circle-path code from somewhere, To show what I mean.

So the start and end of that particular stroke seem to be the other way around from what you need.

 

Just see this as a hint to what went wrong in your demo, not as the absolute solution :) 

  • Like 2
Link to post
Share on other sites

Hey @Dez

 

Welcome back. Look at this example again.
The key is the circle (as Paul mentioned) plus the onUpdate function.

 

See the Pen abvXeoV?editors=1010 by mikeK (@mikeK) on CodePen

 

Here in a close-up. It becomes apparent that the positioning of the individual parts

and the mathematical calculation can still be optimized.

 

See the Pen gOpXozV?editors=1010 by mikeK (@mikeK) on CodePen

 

Put a few more coals on it ...

Mikel

 

 

  • Like 2
Link to post
Share on other sites

Thanks akapowl  for your valued observation. It seems I need to brush up on my path creation.

Also thanks to mikel for your welcome and your reminder from your codepen.

In my updated model I've corrected the path which rectified the rotation, as akapowl noted, now you’ll see my problem is still with the right hand end of the link.

I can’t seem to anchor it to the movement of the piston.

See the Pen ZEpYjyK by spring99 (@spring99) on CodePen

Link to post
Share on other sites

Hi all,

I didn't have this problem when I created my other loco a few months ago.

See

See the Pen KKpGoyP by spring99 (@spring99) on CodePen

 

But the same principle doesn't seem to work correctly this time.

 

Link to post
Share on other sites

Hey @Dez,

 

I've now set up a different, simple concept here.
It looks great with SVG elements. But: There is still a mistake in it.

 

See the Pen zYKGxpe by mikeK (@mikeK) on CodePen

 

Tonight I'm looking at the difference between your old and new implementation - why it doesn't work ...

 

Turn up steam ...

Mikel

 

  • Like 3
Link to post
Share on other sites

Hi Mikel,

It's really good that you're showing a big interest in my project.

I too have had it working with just lines, but when I added the Link as a png or as a svg the problem returns.

I'm trying really hard to turn up the stream but I seem to be running out of it. Must be a leaky boiler.

Good luck tonight.

Dez

Link to post
Share on other sites

 

Hey DEZ,

 

Take a look at the two png PistonLinkage: in the new one, the motif is not at right angles - this could be the problem.

 

Every pixel counts ...

Mikel

  • Like 1
Link to post
Share on other sites

Hi mikel,

It may be me, but I can't find the images you mention.

Did you attach them?

Stay cool, Dez

Link to post
Share on other sites

Okay I can see what you mean now mikel

I'm pretty sure I tried a straight version last week, but I'll have another go to make sure.

Dez

Link to post
Share on other sites

 

So we'll see the solution tomorrow.

 

Just do it.

Mikel

Link to post
Share on other sites

Hi Mikel

It's a little nearer.

https://codepen.io/den_smith/pen/VwKvXYz

It's taken longer than it should have because of Computer problems.

I've had to do another image restore. Along with all the updates etc.

Regards

Dez

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×