Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Improved webgl_geometry_text_stroke and webgl_geometry_text_shapes. #22834

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions examples/webgl_geometry_text_shapes.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
let camera, scene, renderer;

init();
animate();

function init( ) {

Expand All @@ -57,7 +56,7 @@
side: THREE.DoubleSide
} );

const message = " Three.js\nSimple text.";
const message = ' Three.js\nSimple text.';

const shapes = font.generateShapes( message, 100 );

Expand Down Expand Up @@ -116,6 +115,8 @@

scene.add( lineText );

render();

} ); //end load function

renderer = new THREE.WebGLRenderer( { antialias: true } );
Expand All @@ -127,6 +128,8 @@
controls.target.set( 0, 0, 0 );
controls.update();

controls.addEventListener( 'change', render );

window.addEventListener( 'resize', onWindowResize );

} // end init
Expand All @@ -138,12 +141,6 @@

renderer.setSize( window.innerWidth, window.innerHeight );

}

function animate() {

requestAnimationFrame( animate );

render();

}
Expand Down
13 changes: 5 additions & 8 deletions examples/webgl_geometry_text_stroke.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
let camera, scene, renderer;

init();
animate();

function init( ) {

Expand All @@ -58,7 +57,7 @@
side: THREE.DoubleSide
} );

const message = " Three.js\nStroke text.";
const message = ' Three.js\nStroke text.';

const shapes = font.generateShapes( message, 100 );

Expand Down Expand Up @@ -120,6 +119,8 @@

scene.add( strokeText );

render();

} ); //end load function

renderer = new THREE.WebGLRenderer( { antialias: true } );
Expand All @@ -131,6 +132,8 @@
controls.target.set( 0, 0, 0 );
controls.update();

controls.addEventListener( 'change', render );

window.addEventListener( 'resize', onWindowResize );

} // end init
Expand All @@ -142,12 +145,6 @@

renderer.setSize( window.innerWidth, window.innerHeight );

}

function animate() {

requestAnimationFrame( animate );

render();

}
Expand Down