frading Posted September 15, 2003 Share Posted September 15, 2003 Hi, I am trying to use the rayVOP in order to find the width of an object. I am just trying to make it work, so I made a simple test vop net like this one: http://www.doubledose-themovie.com/prodare...ding/vopnet.jpg and the result is as follow: http://www.doubledose-themovie.com/prodare...ding/result.jpg this is not at all what I expected ( the geometry rendered is just a simple sphere ), so I tried to increase raytracing or shading quality, but I did not manage to get better. So any help is highly appreciated! Quote Link to comment Share on other sites More sharing options...
lorduk Posted September 15, 2003 Share Posted September 15, 2003 by width I do hope you mean depth you need to connect the global P to paoint or leave it unconected(you want the distance from shading point to first ray intersection on incent ray), for direction normalize the global I and multiply it by the max depth you want it do test, also rember to multiply the final product so that it would be between 0-1 so it would show up on the alpha channel. take a look at vex documatation for rayHit test, many important features there -Kaspar Quote Link to comment Share on other sites More sharing options...
frading Posted September 15, 2003 Author Share Posted September 15, 2003 ok, I have done what you adviced, and I have the distance from the point being shaded to the last point intersected. This is what I want, but this will give me depth only for simple geometries. But I still have two problems: - first I still do not understand why I have so weird results by plugging the eye position in the P input of the rayhittest. I expected to have the same result than those given by the Pz variable directly connected into the output. But no! whyyyyy? - second, I am surprised that the rayhittest VOP returns the distance to the last point intersected. I would have thought it would return this for the first one. This would have been more useful to determine the depth for complex models where the ray sent would have hit more than two points. I have just written a pseudo algo that should partially solve this problem ( though I still need to make it with VOP and test it, but this is not for today ), but I am really surprised that this is not already somewhere in houdini. Or maybe I just did not see it? And you also told me taht there was really helpful help about that rayhit VOP, but I only found this: -------------- This operator sends a ray from the position P along the direction specified by the direction D, and returns the distance to the object intersected or a negative number if not object found. The position and normal of the intersected surface are returned in phit and nhit. The length of the D vector represents the farthest distance considered when checking for intersections. If the position (P) input is not connected, the global variable by the same name will be used instead. --------------- This seemed to me helpful for sure, but as I still have unanswered questions, I was wondering if there were more information... Quote Link to comment Share on other sites More sharing options...
Jason Posted September 15, 2003 Share Posted September 15, 2003 Just giving this is quick look: did you know that the RayHit direction is not just a direction? It's an actual length that it does a rayhittest() in - i.e., multiply your I vector by some large scalar to make sure that the length of your ray extends all the way through your geometry. Quote Link to comment Share on other sites More sharing options...
frading Posted September 15, 2003 Author Share Posted September 15, 2003 Yes, I did notice after after a few tests, and thx to the help from lorduk. mmm, but actually I just made some test and understood why I had funky results in my first post. This is because I just needed to multuply the I vector by a number slightly higher than 1, and this gives me the beginning of what I want ok, thx, you answered my questions! And I was a bit confused because I though that the rayhit VOP was returning the last point hit, but no, it returns the first one, which is much better for what I am trying to do! Quote Link to comment Share on other sites More sharing options...
lorduk Posted September 16, 2003 Share Posted September 16, 2003 for complex object you would have to implement loop that would add the distance if i is odd number and ignore distance whent it is event, the loop would go on untill max i is reached or max distance, but warned this will do major damage to render times -Kaspar Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted September 16, 2003 Share Posted September 16, 2003 ...also never use Rayhittest result without checking it if (distance < 0) {do nothing} else {lets rock} because "If no object is hit, the distance will LESS than 0 !!!" 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.