Skip to content

About

three.js module to display a ground of grass

Resources

Stars

15 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

threex.grassground

Threex.grassground is a three.js game extension which provides a simple mesh for a flat grass. It is a content extension to help you start your game. It contains a diffuse and a normal texture from three.js. Play with the normal scale and the texture repeat to fit your needs. This could be an easily displayed grassground for your field or you terrain in your three.js game.

Show Don't Tell

A Screenshot

screenshot

How To Install It

You can install it via script tag

<script src='threex.grassground.js'></script>

Or you can install with bower, as you wish.

bower install threex.grassground

How To Use It

First you instanciate the object

var groundMesh	= new THREEx.GrassGround()
scene.add(groundMesh)

There are some options arguments that you can tune to fix your own needs.

var groundMesh	= new THREEx.GrassGround({
	width		: 1,	// the width of the mesh, default to 1
	height		: 1, 	// the height of the mesh, default to 1
	segmentsW	: 1,	// the number of segment in the width, default to 1
	segmentsH	: 1,	// the number of segment in the height, default to 1
	repeatX		: 1,	// the number of time the texture is repeated in X, default to 1
	repeatY		: 1,	// the number of time the texture is repeated in Y, default to 1
	anisotropy	: 16,	// the anisotropy applied to the texture, default to 16
})

Possible Improvements

  • make geometry tunable
    • opts.geometry
    • thus able to use circle geometry for example
    • var geometry = new THREE.CircleGeometry(width/2, 32)

About

three.js module to display a ground of grass

Resources

Stars

15 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages