hey there!
i think that you re just missin the position here. on this SDF function , the shapes are located at the origin of the world, you may need to substract the position where you want your shape from the world coordinate.
Hi , is there a chance you could share your prism shape? I’m doing something similar at the moment and got stuck with getting formulae you mentioned in your original post into Unreal Engine.
Thanks a lot in advance.
Just to give an account of how I handled this: I needed the triangular prism shape to make certain sections of my walls “dither”. After applying the fix suggested by @expose, I got this result:
In addition to changing the location of the shape from the origin, I also had to do some rotation. Here is the final material logic. I will include the material functions I used as well.
This Material takes in a Rotation and a LocOffset. This is done in my Wall blueprint via a few Set Vector Parameter values for my material instance Dynamic.
This is the rotation portion.
The next part is pretty much the same as the picture I attached in the OP. The only difference is how I set the location of the shape (the start of the logic):
Ok, thanks, I got it. So you manually translated this formula into material without using custom node, didn’t you? I’m trying to make a dynamic pie chart taking standard cylinder shape as a base and masking parts of it with triangular prism.