|
|
Le_Forgeron <lef### [at] freefr> wrote:
> Le 21/10/2013 23:24, rodv92 a écrit :
> > Hello group, i need your help. i am trying to move CSG objects along a curve.
> > That's easy, but the problem here is i dont want any gaps between the objects.
> >
> > So, it will involve some trigonometric operations.
> > imagine you have a box and you see it from above.
> > rotation are about the y axis
> >
> > first you have to rotate it at origin multiplied by the while control variable
> > (magsec in my example).
> > Next i will translate it so as the right down side of the box will just touch
> > the previous box edge.
> >
> > the left side will merge with the previous box some more, so there will be no
> > gap.
> >
> > the object is 55.88 wide and 44 depth.
> >
> > the uncorrected translate after the rotate will be 44*magsec. then you have to
> > back it a bit along the z axis to remove the gap.
> >
> > I figured that it will be a z translate of tan(angle)*55.88/2
> >
> > Next you will have to move along the x axis to make the whole path curved
> >
> > I figured that it will be a x translate of sin(angle)*44
> >
> > But these vectors will be affected by the rotation along the curve so I thought
> > that i will need to vrotate them, and add the cumulatively.
> >
> > So here is the SDL :
>
> > Please help me find the problem, or if you know a better algorithm.
> >
> > Thank you.
> >
> >
> Assuming it is something similar to wagons of a train on a railway, I
> would model the railway as a spline, use the magsec as the time index of
> the position of the head of the first wagon (so evaluating the spline at
> magsec provide the position of the head of the first wagon),
> then use a bisecting algorithm to compute magsec2 so that the distance
> between the position of magsec2 and magsec match your constraint.
>
> And so on for all other wagons.
>
>
> --
> Just because nobody complains does not mean all parachutes are perfect.
thank you, but in fact it is not modelling of a train but rather a static maglev
train track. so there is no time involved, and it should be easy.
I will stick for the moment to my algorithm and model it on drafting paper with
my schooldays tools. this way I should find what's going on.
Post a reply to this message
|
|