[Closed] random position on displaced surface via map?
Does anyone have any idea where you would start getting back an array of random position on displaced surface via map?
SDK sample would be great but would be just happy with just a script sample.
Bobo had a great post on getting the array of point3 from a surface…
http://forums.cgsociety.org/showthread.php?f=98&t=837640&page=1&pp=15
Thanks
your task is similar to ‘emitting particles’ from source, where source might be surface or texture based
#1 – surface:
you have a surface with pretty equal distribution of particles and you use texture map as a mask (probability of appearance)
#2 – texture:
you have a texture which ‘emits a particle’ from every pixel with probability defined by … let’s say … value of every pixel. so a scattering of particles on the surface depends on mapping of this surface.
so what is your situation?
Thanks Denis
I’m scattering objects on a surface using the area of a face and pre-calculate points. This works really fast in c++ from ideas in bobo’s maxscript sample.
What I need to do is filter this with a black and white bitmap. I have looked at the displace sample from the SDK. It looks at pixel sample of a bitmap to change the mesh.
I guess what my question is…
How would I use a bitmap to filter my pre-calculated points? Or is there a better way to do this?
Thanks
if you know a bary coordinates for every 3D point you can get a 2D point on texture using same coordinates and triangle (face) index but using map faces. if you know 2d position in uv space you can easy know corresponding position on the texture [width * u, height * (1 – v)]. and get the value of the pixel.