SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 02-03-2005, 07: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, 07: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, 08: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, 08: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, 08: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, 01: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
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.