BookScatter
Plugins linking to this thread: (hide)
Book Shelves
Spawned by the 3DSMax BookScatter plugin by Mourelas Konstantinos, the thread linked below from si-community's Community Projects forum features some interesting approaches of generating/simulating a bookshelf by
multiple authors.
Authors involved so far: caledonian_tartan, Piotrek Marczak and Anto Matkovic.
local backup: bookshelves.zip
Authors involved so far: caledonian_tartan, Piotrek Marczak and Anto Matkovic.
local backup: bookshelves.zip
author site: n/a / si-community thread
-
- Posts: 253
- Joined: 17 Feb 2010, 15:13
BookScatter
Moderator edit - I've forcefully and experimentally moved this topic to our Community ICE Project subforum,
just to focus your attention at that part of the community once again - HB
Hello Community
i stumbled on this a few days ago:
http://mourelask.weebly.com/bookscatter.html
it's a max script to scatter books into a shelf.
what a nice training to do this in ice.
Already (more or less) working is this:
- create Rows and Colums of an arbitrary number of books.
- flip probability
- random scale
- align in Z
- tilt some books
i'm stuck with a few things.
1. if a book is tilted, the other ones should move to the side accordingly. (collision)
2. it should be possible to make some books stapled rather than standing
SceneFile
don't get scared by the messy ice tree. looks worse than it really is. the lower half of it is only WIP...
just download it and fiddle around.
i'd be happy about every input/comment.
cheers
just to focus your attention at that part of the community once again - HB
Hello Community
i stumbled on this a few days ago:
http://mourelask.weebly.com/bookscatter.html
it's a max script to scatter books into a shelf.
what a nice training to do this in ice.
Already (more or less) working is this:
- create Rows and Colums of an arbitrary number of books.
- flip probability
- random scale
- align in Z
- tilt some books
i'm stuck with a few things.
1. if a book is tilted, the other ones should move to the side accordingly. (collision)
2. it should be possible to make some books stapled rather than standing
SceneFile
don't get scared by the messy ice tree. looks worse than it really is. the lower half of it is only WIP...
just download it and fiddle around.
i'd be happy about every input/comment.
cheers
SI 2015 @ WIN7-64
Re: BookScatter
you probably need to check previous particle orientation & scale (bounding box of mesh?) to see how much you can rotate.
just for fun, bookshelf with bullet particles ;)
just for fun, bookshelf with bullet particles ;)
- Attachments
-
- bookshelf_with_bullet.7z
- (147.03 KiB) Downloaded 590 times
Re: BookScatter
Hi there,
here's old one I already have. It performs, let's call it, one dimension packing. The trick is to create an array, take position of two neighboring members, place an appropriate particle in the middle of two. Array is created from bounding boxes sizes. This one works by carefully aligning all members "on the corner", placing centers to bounding box centers (by appropriate SI command). So, group member's global position, represent a half of bounding box. In this way, there is no need for ICE tree on each member of instance group, for calculating bounding box. Rotated ones are just "faked".
As it is noticeable, it's able to align instances of different sizes.
I've added a few comments in ICE tree.
BTW, Origin's solution looks a bit... smarter Anyway, take it here.
here's old one I already have. It performs, let's call it, one dimension packing. The trick is to create an array, take position of two neighboring members, place an appropriate particle in the middle of two. Array is created from bounding boxes sizes. This one works by carefully aligning all members "on the corner", placing centers to bounding box centers (by appropriate SI command). So, group member's global position, represent a half of bounding box. In this way, there is no need for ICE tree on each member of instance group, for calculating bounding box. Rotated ones are just "faked".
As it is noticeable, it's able to align instances of different sizes.
I've added a few comments in ICE tree.
BTW, Origin's solution looks a bit... smarter Anyway, take it here.
-
- Posts: 253
- Joined: 17 Feb 2010, 15:13
Re: BookScatter
thanks guys!
looking forward to check your scenes!
simulating works, and looks quite cool, but i try to avoid to simulate.
i hope i find some time to work on this afternoon.
looking forward to check your scenes!
that's what i do. i check the previous or the next particle depending on it's tilt angle (pos or neg). it also only checks the books group in the same part of the shelf....you probably need to check previous particle orientation & scale (bounding box of mesh?) to see how much you can rotate...
simulating works, and looks quite cool, but i try to avoid to simulate.
i hope i find some time to work on this afternoon.
SI 2015 @ WIN7-64
Re: BookScatter
I was thinking about something different,
vect1 = particle[id+1].position - particle[id].position
vect2 = vect1 - book_height
angle = angle_between(vect1,vect2)
maybe also position +- book width, and book height vector rotated with particle orientation
vect1 = particle[id+1].position - particle[id].position
vect2 = vect1 - book_height
angle = angle_between(vect1,vect2)
maybe also position +- book width, and book height vector rotated with particle orientation
- Attachments
-
- angle.jpg (9.67 KiB) Viewed 10964 times
Re: BookScatter
I was looking at a similar approach to that, Origin, but I think opposite. Knowing the angle of the books (some are tilted), how far would you have to push the book to the side to make room.
That could be accomplished by taking the sin of angle * book height = how far book would move to side (x). You'd also have to account for thickness of books.
The next problem would be if the book next to it was also tilted. I think you could calculate their intersection point via emTools intersecting line compound. But I didn't get that far...
That could be accomplished by taking the sin of angle * book height = how far book would move to side (x). You'd also have to account for thickness of books.
The next problem would be if the book next to it was also tilted. I think you could calculate their intersection point via emTools intersecting line compound. But I didn't get that far...
Re: BookScatter
semi-working ;) solution...
dunno if you can get bounding box of instanced shape in ice. If think for such things some kind of script node would be faster to setup
dunno if you can get bounding box of instanced shape in ice. If think for such things some kind of script node would be faster to setup
- Attachments
-
- bookshelf_bleh.zip
- (145.99 KiB) Downloaded 669 times
Re: BookScatter
about getting bounding box, well there is a stupid trick I've mentioned before, just to put center on bounding box, then to place object "on the corner" to some null or so - distance is then a half of bbox. Actually this works with rotated objects too. Definitively it should be faster to calculate the bbox once for forever. Last time I've tried to get bbox, using ICE tree on each object, it worked, but SI liked to crash.
Re: BookScatter
sure, by multiplying the bounding box size of the original object by the size and scale vector of each of the particleorigin wrote:dunno if you can get bounding box of instanced shape in ice
Re: BookScatter
yes, but it's not possible (?) to get data from .shape attribute (maybe with custom node?)
(when you try to make user-friendly compound, with only shape attribute exposed)
or when you put a group in instance shape node, you can't retrieve group id of object.
I hope I make sense with my pseudo english
(when you try to make user-friendly compound, with only shape attribute exposed)
or when you put a group in instance shape node, you can't retrieve group id of object.
I hope I make sense with my pseudo english
Re: BookScatter
I know you know that group contains array of whatever attribute exists on all members. So, if all members of group have ICE tree which calculates bbox and sets it as custom attribute, it's possible to assign this to particles in point cloud, created by same pattern. self.ID> select in array and so. But doesn't seem to be so stable, at least in my experience.origin wrote:yes, but it's not possible (?) to get data from .shape attribute (maybe with custom node?)
(when you try to make user-friendly compound, with only shape attribute exposed)
or when you put a group in instance shape node, you can't retrieve group id of object.
I hope I make sense with my pseudo english
Re: BookScatter
When you selecting a group in instance shape node you still need to provide id of the object for each of the particle. Sure, you should also provide the name of the group for a compound, it is an ice limitation, user should deal with it, because it is nesssecary for selecting the object from the group array to get bounding box information.origin wrote:yes, but it's not possible (?) to get data from .shape attribute (maybe with custom node?)
(when you try to make user-friendly compound, with only shape attribute exposed)
or when you put a group in instance shape node, you can't retrieve group id of object.
Look at my messages, I make mistakes all over the place and sadly nobody even corrects me :Рorigin wrote:I hope I make sense with my pseudo english
Exactly. Basically when you referencing a group name in Get Data node you get an array of attributes of its objects which matches the id of particles, if the same group was selected as an instance groupMathaeus wrote:that group contains array of whatever attribute exists on all members. So, if all members of group have ICE tree which calculates bbox and sets it as custom attribute, it's possible to assign this to particles in point cloud, created by same pattern. self.ID> select in array and so.
Who is online
Users browsing this forum: No registered users and 18 guests