8BitBeard Posted June 30, 2017 Share Posted June 30, 2017 I have this nice setup. What I'm going for is a surface that I can model freely, and then apply all kinds of different objects onto it by using points that are raycast onto the surface. This way the applied objects are independent from the original object and their placement won't be messed up by changing numbers of e.g. prims on the base model. This is mostly going to be used to construct buildings with various windows, doors, etc. This is how it looks like currently: The objects are placed by a raycast from the point onto the surface. I have checkboxes for aligning the object to the center of the primitive or moving them freely. I can also scale the objects corresponding to the primitive size. However, I'm still having the following problem: Scaling only works on vertically aligned primitives, as the calculation of the height and width of the primitive is very simplistic. Can anyone help me with this calculation, so it also works on angled / non-vertically aligned primitives? I know that "height / width" will mean something different, depending on which side the primitive is on. I was looking into adding in a direction that's coming from the center of the base object or even add a checkbox that allows to 'flip' the height and width (which would require to place some objects individually depending on where they are supposed to go ,which would be fine). Any help on this is greatly appreciated, the .hip is attached: excercise_11_ray.hiplc Quote Link to comment Share on other sites More sharing options...
julian johnson Posted July 2, 2017 Share Posted July 2, 2017 I think there are much simpler ways of doing this but here's one anyway. I've tried to leave your tree as intact as possible. Not sure what you intended for primitives with non-rectangular shapes, though.... excercise_11a_ray.hipnc Quote Link to comment Share on other sites More sharing options...
8BitBeard Posted July 2, 2017 Author Share Posted July 2, 2017 Thank you very much julian. If there are simpler ways, can you point me towards a reference? I'm still learning and probably do many thing much more complicated than necessary. The intention of this system is to have a tool that helps me build house facades much quicker. The boxes I am aligning in this example stand in for facade details such as windows, doors, ventilation objects, support beams, etc. In some instances I not only need to orient these objects towards the surface (which I already did with my first version), but also know the boundaries of the primitive they are projected on. For example a window that is always aligned at the bottom of a primitive, or a support beam that will be scaled to match the primitive size. To give some context, this is a shot of a building created with my current version of the tool: Quote Link to comment Share on other sites More sharing options...
julian johnson Posted July 2, 2017 Share Posted July 2, 2017 (edited) I was thinking the for loops in both the main tree and the subnet were unnecessary, probably, as the copy function is effectively a for loop by itself. Anyway, take a look at the attached scene - it removes both for loops but this time it does take liberties with your original scene! excercise_11b_ray.hipnc excercise_11c_ray.hipnc Edited July 3, 2017 by julian johnson improved alignment of boxes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.