Normalising Rotations for Procedral Modeling

   1473   1   0
User Avatar
Member
8 posts
Joined: May 2016
Offline
Hi All.

I'm doing a little procedural modeling and I need a little help with some normalising.

I have an arbitrary plane with 4 points from which I am using point0 and point1 to generate a new curve with 2 points.
The new curve then creates a new planar piece of geometry using an extrusion.

The problem is I need to extrude this new plane to cover the area of the original shape.
Imagine a triangle with arbitrary rotations. I'm taking the bottom edge and extruding it to create a new rectangle that covers the original. If the triangle has an angle in the base larger than 90 degrees (or if the orignial shape is more like an octagon) then the plane extruded will not cover the original shape. (I hope this makes sense).

I would use the bounding box of the object to create a shape that fits but I need the new plane to line up along the bottom edge..

What I would like is to rotate the original shape so that its edge - point0 to point1 is made/xformed to line up with the x axis point and the normal of the primitive points up in Y. The original shape and this new shape would have the same aspect ratio but the new shape would be scaled rotated and transformed such that the first edge fits along the 0-1 line of the x axis.

Any help appreciated.
Loving the support on the forums.

Tim.


Edited by timcivil - May 29, 2016 21:05:14
User Avatar
Member
182 posts
Joined: April 2009
Online
if you want to cover the original triangle, then you need to take skewing into account too. A simpler way to do this would be to get half of the vector from point0 to point1 and use it as an offset position from point2. Then create the new primitive from point0, point1, point3 (new), point4 (new).
Edited by blackpixel - June 3, 2016 01:33:35

Attachments:
offset_rect.hip (103.7 KB)
offset_rect_viewport.jpg (41.9 KB)
offset_rect.jpg (41.3 KB)

  • Quick Links