JoshJ Posted August 1, 2010 Share Posted August 1, 2010 (edited) I'm trying to deform a volume into polar coordinates. I have 3 examples in the included file. The first is a successful attempt to deform a polygon mesh with a vopsop that transforms it from cartesian to polar coordinates. The second example is a volume with a volume vop, with a volume sample node whose position is driven by the same vop nodes from example 1. However, the volume deforms, but the result looks totally wrong. The third example is volume whose attributes are transferred to a point cloud, then deformed to polar coordinates, then sampled again to form a new volume. This way works, but seems to have lost a lot of detail. Can anyone take a look and see if we can get something like example 2 working? Thanks! Edit: By the way, this is an H11 file. volume_polar_coordinate_transformation.hipnc Edited August 1, 2010 by joshjordan 1 Quote Link to comment Share on other sites More sharing options...
brianburke Posted August 2, 2010 Share Posted August 2, 2010 This seems tricky. You sort of need to "pull" the value out of the volume rather than "push" it like this file is currently doing I think. I guess that means that you need to get your point out of spherical coordinates back into Cartesian and do the volume sample. Despite looking at old textbooks I couldn't get that formula right so here's a hack with a pc lookup that gets it right but introduces a bias :-( . I guess if the y bounds are greater than pi it's going to alias even without the bias of the pc lookup so I normalized them to that range. I'd be really stoked to see the spherical to cartesian xform properly set up... Curious to see someone with more math skillz set this up vol_sphr_coords.hipnc Quote Link to comment Share on other sites More sharing options...
JoshJ Posted August 2, 2010 Author Share Posted August 2, 2010 Thanks for replying, Brian, and for the example file. Yeah, there's some really fine detail I want to preserve in the volume (in another scene I'm working on), so I was hoping I could directly deform it without having to sample point clouds. One way I was thinking could work though, is if I could make a point for each volume voxel, with an attribute for the volume index coordinates and placing the point in the center of each voxel, and do all the transformations on the points, then just transfer the info back to each volume voxel based on the info from the points. But I didn't successfully get that working yet... In the process of problem solving, I'm just kind of learning the math as I go. Attached is a volume vop that includes an attempt at the reverse transformation... just used a formula from: http://www.mathsisfun.com/polar-cartesian-coordinates.html I didn't have time to properly test or build an example with it yet, but wanted to post in case it might help you in figuring out the solution. volume_polar_coordinate_reverse.hipnc 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.