polytrails + problem

I scripted a simple polytrail system, for weapon trails and the like, but I ran into a little problem.
When moving vertices with a script, it’s only possible to use a local coordinate system, which means I had to figure out how to convert the local system to a global one (the trail object needs to be parented to whatever it’s following, or else it gets culled when the centerpoint leaves the camera frustum)
My answer was to vertex parent it so I didn’t have to deal with converting orientation coordinates, and then add the change in object position. This is all fine and dandy, but the offset seems to be a frame behind- if the parent object is moving too fast the whole trail moves around.

I can’t figure out what I can do to fix the problem, any ideas?
The example file is hardly commented, but the only important part is the offset and that’s pretty simple.

[edit] I put the wrong file up, my bad

Attachments



lightSaber.blend (455 KB)

I hate to bump this, but, c’mon, 45 views and no posts?

…also, I’m attaching a couple screencaps for people who don’t want to blindly download a file.

It’s a cool effect, something I’ve been wondering about how it’s done. The trail feels too long though. Can’t offer any advice on the problem.

You can shorten the trail by removing segments from the end (or reducing the delay variable, if it’s above 0)- just remember to get the UV’s back in order after.

Found a solution but the trail will disappear every time the object is out of frame…

Just unparent the trail object from the blade
Then set: o.worldPosition = blade.worldPosition

maybe we need an ability to manualy turn off culling on selected objects… if that is possible?

Interesting…

Unparenting the trail and setting the position works perfectly. Now I just have to figure out the issue of instancing, I hear that may be solvable come 2.49b, with the mesh updating additions.

looks really cool but don’t seems to work on 2.6. Can’t help though, sorry about that. =/

It says it is written in 2.49. I haven’t checked to file but I do not think it is upgraded to Python 3. It might use deprecated API too.

BTW. This file is the buggy one (it is support forum).
You might want to check the resource forum.