CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
reply share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-15-2014, 02:47 PM   #1
jpedleham
Veteran
 
jpedleham's Avatar
portfolio
Jack
VR Designer
Darlington, United Kingdom
 
Join Date: Jan 2014
Posts: 84
Are there any random stack scripts available?

Hi, im working on a project with a tight deadline and i want to find a script or some way of quickly generating stacks of boxes akin to the image below. Does anyone know of a script that would help me achieve this effect?



Thanks
Jack
 
Old 04-15-2014, 02:57 PM   #2
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
though it looks random, the "floor" position of each stack is probably best resolved using the classic 2d bin packing algorithm.

then maybe something recursive on each new box placed ie the box top is a new bin packing region, repeat until a random height is achieved maybe.

Last edited by Klvnk : 04-15-2014 at 03:03 PM.
 
Old 04-15-2014, 03:07 PM   #3
jpedleham
Veteran
 
jpedleham's Avatar
portfolio
Jack
VR Designer
Darlington, United Kingdom
 
Join Date: Jan 2014
Posts: 84
Im beginning to wonder whether i could use the basic compound scatter and hide the imperfections manually or under cloth sims. That algorithm is very interesting though! I myself havent ventured into scripting yet but i hope someone does turn that packing into a maxscript.
 
Old 04-15-2014, 03:15 PM   #5
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
if you go down the scatter approach, have a look at something with particle flow. you could even map distribution weights on to the emitter surface.
 
Old 04-15-2014, 03:17 PM   #6
jpedleham
Veteran
 
jpedleham's Avatar
portfolio
Jack
VR Designer
Darlington, United Kingdom
 
Join Date: Jan 2014
Posts: 84
Thanks i took a look at that script earlier today and it does a good job of stacking but it leaves large gaps between the boxes as well as massively intersecting some too.



EDIT: Ill take a look at that boxes script too. Also as for Particle flow i hadnt thought of that! Ill have a go and see what i can come up with thanks!
 
Old 04-15-2014, 03:20 PM   #7
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
Quote:
That algorithm is very interesting though! I myself havent ventured into scripting yet but i hope someone does turn that packing into a maxscript.


luckily it been done

Last edited by Klvnk : 04-15-2014 at 03:26 PM.
 
Old 04-16-2014, 05:52 AM   #8
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
thinking about it I'd be inclined to do it by hand.

decide how many "Base" crates you are going to use model them up, add some world space fractal noise/grunge or world space grunge textures (to add variation on their position) .... some various stencil graphics, 1,2,3,4 etc, fragile, this way up, classified, property of etc (in a typical stencil font). Be clever with the mapping and textures so that every different texture is interchangeable and therefore can be randomized or swapped between crates.

Then from these build up bigger building block, cloning rotating etc, swapping textures. then keep repeating this process until you blocked out the whole scene. finally scatter some random crates around to break up any obvious repetitions.

it sound daunting when you start but I think it's no worse/slower than correcting the scatter/particle/script and probably give a better result.

20 mins to bash this rubbish out


Last edited by Klvnk : 04-16-2014 at 10:27 AM.
 
Old 04-16-2014, 01:48 PM   #9
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,094
Send a message via ICQ to denisT
it looks too repeatable. and very funny... many times repeated random configurations if it was a human who packed it, he was frantic

Last edited by denisT : 04-16-2014 at 01:52 PM.
 
Old 04-16-2014, 01:54 PM   #10
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,094
Send a message via ICQ to denisT
honestly i don't have a good programming algorithm in my head for this task.
 
Old 04-16-2014, 02:14 PM   #11
Klvnk
Lord of the posts
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 699
yeah but it's only 3 different stacks with no randomized material and 20 mins work. what did I discover after I did that one was to random delete the top most elements to produce a more randomized effect, if you use that add more boxes than you think you need.


Last edited by Klvnk : 04-16-2014 at 02:43 PM.
 
reply share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:15 PM.


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