@@ -56,6 +56,7 @@ const ATTRACTORS = {
5656 dt : 0.01 ,
5757 T : 600 ,
5858 scale : 3 ,
59+ maxPointsPerFrame : 13 ,
5960
6061 cameraPosition : [ 0 , 3 , 10 ] ,
6162 cameraLookAt : [ 0 , 2 , 0 ] ,
@@ -91,6 +92,7 @@ const ATTRACTORS = {
9192 dt : 0.001 ,
9293 T : 200 ,
9394 scale : 1.8 ,
95+ maxPointsPerFrame : 50 ,
9496
9597 cameraPosition : [ 0 , 45 , 80 ] ,
9698 cameraLookAt : [ 0 , 45 , 0 ] ,
@@ -118,6 +120,7 @@ const ATTRACTORS = {
118120 dt : 0.01 ,
119121 T : 1000 ,
120122 scale : 1.6 ,
123+ maxPointsPerFrame : 35 ,
121124
122125 cameraPosition : [ 0 , 15 , 45 ] ,
123126 cameraLookAt : [ 0 , 8 , 0 ] ,
@@ -145,6 +148,7 @@ const ATTRACTORS = {
145148 dt : 0.01 ,
146149 T : 1800 ,
147150 scale : 12.0 ,
151+ maxPointsPerFrame : 35 ,
148152
149153 cameraPosition : [ 45 , 45 , 45 ] ,
150154 cameraLookAt : [ 0 , 0 , 0 ] ,
@@ -170,6 +174,7 @@ const ATTRACTORS = {
170174 dt : 0.005 ,
171175 T : 250 ,
172176 scale : 5.0 ,
177+ maxPointsPerFrame : 25 ,
173178
174179 cameraPosition : [ 45 , 45 , 45 ] ,
175180 cameraLookAt : [ 0 , 0 , 0 ] ,
@@ -195,6 +200,7 @@ const ATTRACTORS = {
195200 dt : 0.005 ,
196201 T : 900 ,
197202 scale : 2.0 ,
203+ maxPointsPerFrame : 30 ,
198204
199205 cameraPosition : [ 60 , 45 , 25 ] ,
200206 cameraLookAt : [ 2 , 5 , 0 ] ,
@@ -224,6 +230,7 @@ const ATTRACTORS = {
224230 dt : 0.01 ,
225231 T : 300 ,
226232 scale : 3 ,
233+ maxPointsPerFrame : 30 ,
227234
228235 cameraPosition : [ 0 , 0 , 5 ] ,
229236 cameraLookAt : [ 0 , 0 , 0 ] ,
@@ -260,6 +267,7 @@ const settings = {
260267 scale : 3 ,
261268
262269 pointsPerSecond : 3.0 ,
270+ maxPointsPerFrame : 3.0 ,
263271
264272 trail : 0.7 ,
265273 band : 0.005 ,
@@ -475,6 +483,9 @@ function applyPreset(name) {
475483}
476484
477485function applyCameraPreset ( def ) {
486+
487+ settings . maxPointsPerFrame = def . maxPointsPerFrame ;
488+
478489 camera . position . set (
479490 def . cameraPosition [ 0 ] ,
480491 def . cameraPosition [ 1 ] ,
@@ -555,14 +566,14 @@ function setupGUI() {
555566
556567 trackController (
557568 simulationFolder
558- . add ( settings , "T" , 10 , 1000 , 1 )
569+ . add ( settings , "T" , 10 , 3000 , 1 )
559570 . name ( "Total Time" )
560571 . onFinishChange ( rebuildTrajectory )
561572 ) ;
562573
563574 trackController (
564575 simulationFolder
565- . add ( settings , "scale" , 0.05 , 10 , 0.05 )
576+ . add ( settings , "scale" , 0.05 , 18 , 0.05 )
566577 . name ( "Scale" )
567578 . onFinishChange ( rebuildTrajectory )
568579 ) ;
@@ -584,19 +595,10 @@ function setupGUI() {
584595 } )
585596 ) ;
586597
587- trackController (
588- visualFolder
589- . add ( settings , "band" , 0.0005 , 0.05 , 0.0005 )
590- . name ( "Glow Band" )
591- . onChange ( function ( value ) {
592- uniforms . u_band . value = value ;
593- } )
594- ) ;
595-
596598 trackController (
597599 visualFolder
598600 . add ( settings , "intensity" , 0.1 , 5.0 , 0.1 )
599- . name ( "Glow Intensity " )
601+ . name ( "Trail Length " )
600602 . onChange ( function ( value ) {
601603 uniforms . u_intensity . value = value ;
602604 } )
@@ -618,7 +620,10 @@ function animate(t) {
618620
619621 // reveal the line progressively
620622 const elapsed = ( t - revealStartTime ) * 0.001 ; // seconds since start
621- drawCount = Math . min ( drawCount + Math . floor ( elapsed * settings . pointsPerSecond ) , trajectory_points . length ) ;
623+
624+ const pointsThisFrame = Math . min ( Math . floor ( elapsed * settings . pointsPerSecond ) , settings . maxPointsPerFrame ) ;
625+
626+ drawCount = Math . min ( drawCount + pointsThisFrame , trajectory_points . length ) ;
622627 geom . setDrawRange ( 0 , drawCount ) ;
623628
624629 // head index is drawCount-1
@@ -646,4 +651,3 @@ setupGUI();
646651applyCameraPreset ( ATTRACTORS [ settings . attractor ] ) ;
647652rebuildTrajectory ( ) ;
648653requestAnimationFrame ( animate ) ;
649-
0 commit comments