Heightfield with multipe materials

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Heightfield with multipe materials

Postby Yezide » Fri Jan 21, 2011 5:47 pm

Is it possible to have a height field with several types of materials? For examples, have part of the heightmap being slippery and others parts having more friction.

If possible, I am guessing it has something to do with the attribute data, but I cannot seem to figure out where to use them. So far I have only seen it in raycasting functions, but nothing with regards to collisions.

Any help would be very appreciated!
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: Heightfield with multipe materials

Postby Julio Jerez » Fri Jan 21, 2011 6:25 pm

you will have to make a material and in the material get the FaceID.
Then Base of the Face ID in the call back do make you decision.

This would be the same way you would do for a Collision trees.

if you look at teh wiki tutorial
http://newtondynamics.com/wiki/index.php5?title=Tutorial_201:_-_Advanced_Custom_Material_System

The is a implementation of a Unificde Latyerial Sysrtem that uses SubSghape IDs instead of Newton material
'you can chekc it out and see hwo you cna get teh subID of any object, Terrain, convex shape, Collision Trees, Use Data
all with a unified callback tah use a Hash table.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Heightfield with multipe materials

Postby Yezide » Sat Jan 22, 2011 6:02 am

Ah, thanks!

Missed that tutorial somehow...
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron