Jump to content

Lining a grass object clip map up with parent object


photo

Recommended Posts

Currently it is not easy to align a grass object to it's parent object.

We are looking at a system of doing large amounts of grass with fine detail fairly quickly.

The relationship between the bounds of the grass object and it's size are not immediately obvious. It seems to be (size X + 1) by (size Y + 1) plus 0.1 for margins.

If the node is scaled the object scales up and the margin seems to increase quite dramatically.

 

What is going on here?

 

[edit1] Ok I can see that the parameters scale/aspect/height parameters all effect the bounding box.

In addition to the bounding box would it be possible to draw a rectangle that shows exactly where the clip map texture is in relation to the parent object?[/edit1]

 

[edit2]

would something like the following in the update_dynamic function of the Grass object in the editor script do the trick?

 

	
vec3 p0 = grass.getPosition();
vec3 s0 = grass.getScale();
engine.visualizer.renderQuad3D( p0,
			p0 + vec3(grass.getSizeX()*s0.x,0,0),
			p0 + vec3(grass.getSizeX()*s0.x,grass.getSizeY()*s0.y,0),
			p0 + vec3(0,grass.getSizeY()*s0.y,0),
			vec4(10.f,1.0f,0.0f,0.125f));

[/edit2]

Link to comment
×
×
  • Create New...