Official Codebase of 3DCodeVerse
Python
graphics lab: the stream, structural-fire and campfire meadows keep their look under the shared wind
gaoypeng2a439aa903bb
diff --git a/harness/examples/graphics_lab/scenes/campfire.js b/harness/examples/graphics_lab/scenes/campfire.jsindex 67298c4c..51a5fd19 100644--- a/harness/examples/graphics_lab/scenes/campfire.js+++ b/harness/examples/graphics_lab/scenes/campfire.js@@ -51,7 +51,7 @@ export function createScene() {height:.12, bladeWidth:.006, maxBlades:135000, dry:.43, seed:31,heightAt:groundHeight, shadows:false,mask:(x,z)=>smooth(Math.hypot(x,z),1.04,2.0)*smooth(Math.hypot(x-8,z+1),2.65,3.7),- wind:{strength:.12,speed:.8}}));scene.add(grass);+ wind:{dir:[1,.3],strength:.24,speed:.8/1.2}}));scene.add(grass);const grove=[[-9,-6],[-9.6,-10],[-.7,-10],[3.7,-11],[9.4,-10],[13,-6],[-8.5,.5],[15,1.5],[-2.8,-17],[6.8,-19]];for(let i=0;i<grove.length;i++) {diff --git a/harness/examples/graphics_lab/scenes/stream.js b/harness/examples/graphics_lab/scenes/stream.jsindex b1f836d1..e1445188 100644--- a/harness/examples/graphics_lab/scenes/stream.js+++ b/harness/examples/graphics_lab/scenes/stream.js@@ -204,7 +204,7 @@ export async function createScene() {const thin = .7+.3*Math.sin(x*1.9+z*.7)*Math.sin(z*1.2-x*.4);return edge * thin;},- wind: { direction: [0.8, 0.3], strength: 0.5, speed: 0.8 },+ wind: { dir: [0.8, 0.3], strength: 1.0, speed: 0.8 / 1.2 },});grass.position.x = xOffset;scene.add(grass);diff --git a/harness/examples/graphics_lab/scenes/structural_fire.js b/harness/examples/graphics_lab/scenes/structural_fire.jsindex cefdd8cf..e05650be 100644--- a/harness/examples/graphics_lab/scenes/structural_fire.js+++ b/harness/examples/graphics_lab/scenes/structural_fire.js@@ -60,7 +60,7 @@ export function createScene(){// A few fallen beams and fragments connect the damaged roof to the yard.for(let i=0;i<18;i++){const debris=box('FallenTimber',[.10+random()*.05,.08,.35+random()*.7],[(random()-.5)*5.7,.08,2.4+random()*1.7],char);debris.rotation.y=random()*Math.PI;debris.rotation.z=(random()-.5)*.15;}const grass=makeMeadow({size:[30,26],density:170,height:.22,dry:.24,maxBlades:90000,seed:32,- mask:(x,z)=>Math.min(1,Math.max(0,(Math.max(Math.abs(x)-3.8,Math.abs(z)-3.5))*.9)),wind:{strength:.34,speed:1.1}});scene.add(grass);actors.push(grass);+ mask:(x,z)=>Math.min(1,Math.max(0,(Math.max(Math.abs(x)-3.8,Math.abs(z)-3.5))*.9)),wind:{dir:[1,.3],strength:.68,speed:1.1/1.2}});scene.add(grass);actors.push(grass);for(let i=0;i<5;i++){const tree=makeTree({height:8+i*.5,crownRadius:2.5,leafDensity:.40,maxLeaves:5500,leafSegments:4,seed:100+i,shadows:false});tree.position.set((i-2)*5.5,0,-9-random()*3);scene.add(tree);actors.push(tree);}const fire=makeFireField({name:'CottageSharedFire',seed:107,quality:'high',wind:[.32,.10],intensity:.88,emitters:[