Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 02-03-2005, 08:45 PM   #1
Neo-MatrixX
Registered User
 
Neo-MatrixX's Avatar
 
Join Date: Feb 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mel help

Hello,

I'm trying to create a number of cones randomly on the ground
using mel.
so far i have the following, but cant figure out how to get the
cones on the ground.

vector $rand;
for ($i = 0;$i<20;$i++)
{
$rand = sphrand(10);
cone -p ($rand.x) ($rand.y) ($rand.z);
}


If anyone could, it would be greatly appreciated
Neo-MatrixX is offline   Reply With Quote
Old 02-03-2005, 08:59 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

What exactly is your ground?
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 02-03-2005, 09:02 PM   #3
Neo-MatrixX
Registered User
 
Neo-MatrixX's Avatar
 
Join Date: Feb 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It can be any flat surface like a polygon plane.
Neo-MatrixX is offline   Reply With Quote
Old 02-03-2005, 09:11 PM   #4
LauriePriest
Moderator
 
LauriePriest's Avatar
 
Join Date: May 2003
Location: London
Posts: 1,001
Thanks: 0
Thanked 59 Times in 51 Posts
Default

you have a random value on the y axis, would that make it so that they would go anywhere rather than stay on one plane?
LauriePriest is offline   Reply With Quote
Old 02-03-2005, 09:26 PM   #5
Neo-MatrixX
Registered User
 
Neo-MatrixX's Avatar
 
Join Date: Feb 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah feel free to change the coding in anyway,
as long as the cones are placed randomly on a flat surface

thanx
Neo-MatrixX is offline   Reply With Quote
Old 11-03-2005, 02:53 PM   #6
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

float $xpos;
float $ypos;
float $zpos;

for ($i = 0;$i<20;$i++)
{
$xpos = rand(-10, 10);
$ypos = 0;
$zpos = rand(-10, 10);

cone -p $xpos $ypos $zpos;
}


that's what i'd do. You could make it "clever" by making take the size of the surface into account but I don't have time to write that atm.


Alan
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 09:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 04:41 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.