outposttom Posted February 18, 2021 Share Posted February 18, 2021 Hi, I'm currently trying to implement a smoke volume that wraps around the X-axis. Essentially taking the values of the final voxels on the +X axis and applying them to -X. The VEX below should be doing what I want, but its returning zero every time. Am I missing something? I've tried deriving the voxel coordinate procedurally, as well as manually specifying a good known coordinate, and every time I get an empty result. Its driving me mad! float scratchpad = chf('scratchpad'); int far_voxel = floor(ch('../smokeobject1/sizex') / ch('../smokeobject1/divsize')); vector sample_pos = volumeindextopos(0, "density", set(far_voxel, @iy, @iz)); if(@ix == 0){ //f@density = 1.0; //f@density = volumeindex(0, "density", set(far_voxel, i@iy, i@iz)); //v@vel = volumeindex(0, "vel", set(far_voxel, i@iy, i@iz)); f@density = volumesample(0, "density", sample_pos); v@vel = volumesamplev(0, "vel", sample_pos); } The commented out lines are different methods I've tried with no success. So far I've tried using volumeindex to read the voxel values directly, and volumesample using a position derived from volumeindextopos. No dice Any ideas folks? (the attached image shows the current behavior using the wrangle VEX above. What should be happening is the density and velocity values on +X boundary should be being copied into the -X boundary voxels) 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.