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 Tools Display Modes
  03 March 2009
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
  03 March 2009
try this, if you want your random data float then use a=1.0 b=1000.0

function writeout = (
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
  03 March 2009
Thumbs up

thanks very much,losbellos
it perform perfect !
  03 March 2009
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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
Society of Digital Artists

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

All times are GMT. The time now is 05:32 AM.

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