Jump to content
  • Advertisement
Sign in to follow this  
oxygen728

Maya - Some simple terrain help please...

This topic is 5407 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Thanks in advance for your time. I'm using Maya 6.0... and hope to export the scene as a Mesh (.X) file. (I already know how to do that.) I've been trying to create some simple terrain for this game. Here's what I would like to have: 1. (easy) Roughly 200-600 triangles in the end. 2. (harder) A color change with elevation. 3. (harder) A texture that is blended with the color. What do I know in maya? Well I've been experimenting with some tutorials dealing with HeightMaps (height fields), but they don't quite make sense to me. I think it has something to do with the fact that most of them are in Maya 4. I'm pretty good at manipulating polygons and such, but I'm not very good at all with Materials/Textures/etc... The most I can really do is apply a texture to polygonal objects. Closest I have come to decent terrain: 1. Created a 1x1 plane with 32x32 subdivisions 2. Created a HeightField through the Hypershade Window using a heightmap (32x32 pixel) image that I created in PaintShop Pro. Just can't figure out where to go from here... Tutorials just assume that I know more than I do at this point! Thanks again for the help.

Share this post


Link to post
Share on other sites
Advertisement
1. Easy one, have you complete this one?

2. If you use a 3d texture called snow, It build on worldspace coordinates, and you supply it with one orig. color and one snow color, and then you have some paramters to tweak the interpolaton.. but If you wish to have greater control(always prefered )over the effect you should use a ramp texture, ( it pretty much speak for itself. )Or you can use both snow, and ramp at the same time.

3. Texture that is blended with the color( don't know excactly what color you mean, but I guess on, vertex colors? ), The easy way to do this is use paint vertex tool("edit polygons->Colors->Paint vertex Tool"), an just start painting like Van Gogh.
If you wish to do this using mel, you will have to query every vertex's color, and the determine what texels this vertex should have, and make a blend( muliply or whatever ).

Now I have a question for you, how do you export the .X files?, I use Maya 6.0 For modelling /texturing etc, but when I wish to convert I save it as .Obj, and take it into Maya 5.0 and then convert it using that plugin at Highend3d.

/ Christoffer

Share this post


Link to post
Share on other sites
1. Yes and No. I can put a subdivided plane down... but I don't know the proper way of making it into the physical shape of the terrain.

2. I'd like there to be a certain color based on each vertex's elevation. Example: Greener for 0 elevation and white for MAX elevation. Something that examines each vertex and assigns a color based on it's y-coordinate.

3. Yes I'd like to blend a basic greyscale texture with the vertex colors... once the vertex colors have been determined in step 2.


www.oxygen728.com/xExport.zip

EXPORTS X FILES: This took me a LONG time to find a fix for... and finally somebody, somewhere took the time to update the source code from the Maya 5.0 exporter that comes with the DIRECTX SDK.

Since I had been fooling around with so many versions of exporters from many different people (many that didnt work) I ended up with some extra files, I'm sure... but to be safe... copy all of the files from the zip file into the Alias\Maya 6.0\devkit\plug-ins\ directory ... and the Alias\Maya 6.0\Lib directory.

The Lib directory probably only needs the .Lib file... but since the files are small I put all of the files both places.

Also Note: I have to open my exported meshes in notepad and change the PATH for each texture from "C:/document and settings...bla bla bla" to "filename.jpg" ... If you catch my drift.

Let me know if you need help with this, I will help the best I can.

Share this post


Link to post
Share on other sites
1. To create a pysical mesh, do this... Create an nurbsplane and scale it to "correct" size, then assign a shader to it, and create a displacment map to the shader(using your displacment map).. The select the nurbsPlane that you previously created and use "displacment to polygons"-command ( Modify->Convert->Displaclemnt to Polygons ), then it's just to tweak some parameters.

2. Use Mel, made up a quick example, just so you get the idea:

string $terrainObj[] = `ls -sl`;
int $terrainVertexCount = query terrainObj;
float $yVal = 0;

int $i = 0;

for( $i; $i < $terrainVertexCount; $i++)
{
$yVal = xform -q -t -ws ($terrainObj+".vtx["+$i+"]";
switch{$yVal)
{
case( range) // This is for General Color(example Green)
clamp($yVal) // This is the gradient
Assign to Vertex
}
}


Thanks for the xExport link....

Share this post


Link to post
Share on other sites
woohoo, good news... Got the heightmap business working.

Now to figure out how to change colors as the elevation increases....

Thanks again for the help!

Share this post


Link to post
Share on other sites
Well, I learned what MEL is -- Thanks for the example (Time to learn another language).

There are plenty of tutorials with MEL it seems, should go pretty smooth I think.

Thanks again!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!