simple question about create random data

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2009   #1
simple question about create random data

I want create a dat file with random function (random point3)
and I want the number be big enough : 44 sets and every set have 500 position values
the following is my plan
for i =1 to 44 do
(
for i=1 to 500 do
(
random [num,num,num] [num,num,num] --is this enough??
)

)
create file --dont know how to realize
write data to the file --dont know how to realize
so much I can think of , need help to full of it
many thanks
 
Old 03 March 2009   #2
try this, if you want your random data float then use a=1.0 b=1000.0



function writeout = (
a=1
b=1000
extfile = createfile "d:/randomdata.dat"
for i= 1 to 44 do (
format "set %\n" i to:extfile
for k=1 to 500 do (
format "% % %\n" (random a b) (random a b) (random a b) to:extfile
)
format "end set %\n" i to:extfile
format "\n" i to:extfile
)
close extfile
)
writeout()
 
Old 03 March 2009   #3
Thumbs up

thanks very much,losbellos
it perform perfect !
 
Old 03 March 2009   #4
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:54 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.