Posted April 03, 2025 by LemonToast Games
Lookat them weird trails, Lolz
To create a new trail:
var myTrail = new LemonTrail(_age, _initial_force_vector, _initial_force_strength, _quad_interval);
Create trail spawning shapes such as squares, hexagons, and other radially symmetrical shapes using thecreateShape
function inside of your trail. This allows you to define the radius, number of points, color, and the animation curve to use for the profile of your trail:
// Note: This method is not idea as it requires you to create a custom transformation matrix // for these shapes in order to attach them to your meshes properly, which can be a very daunting task. // Instead we recommend importing your LemonTrails from Blender! var shape = myTrail.createShape(_radius, _num_points, _color, _animCurve);
Update the positions of the shapes and draw them using the updateTrail
and drawTrail
functions respectively:
// Update the trail myTrail.updateTrail();
// Draw the trail, Call this after setting the transformation matrix for your mesh myTrail.drawTrail(_tex, _shader);
Import LemonTrail data using the LemonTrail_import
function. This parses a JSON file created by our Blender exporter:
// Import LemonTrail data from a file var shapes = LemonTrail_import(myTrail, _file_path, _color, _animCurve);
With Blender, you can attach several trails to a single mesh!