Zero Posted August 31, 2011 Share Posted August 31, 2011 I'm sure this is trivial and I am completely missing something, so I do apologise in advance, but I just can't figure out how to do this: I have an object, that I want to act like a "sprite", i.e. I need it to always point towards the camera of the viewport. That is, not a proper camera object, but rather whatever "camera" is being used to look at the scene in the 3D viewport. I hope that makes sense. So, as the user tumbles the viewport, the object needs to rotate along such that it always faces the current point of view. Any help will be much appreciated. P.S. I did search in the forums before posting, but all I found was a topic on how to make point normals face a given camera object. Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted August 31, 2011 Share Posted August 31, 2011 There is a Look At parameter on your geometry object. Just add the camera there. Quote Link to comment Share on other sites More sharing options...
Zero Posted August 31, 2011 Author Share Posted August 31, 2011 There is a Look At parameter on your geometry object. Just add the camera there. Well, as I said, I don't want it to point at an existing object in my scene, I want it to point at whatever position the scene is being looked at though the viewport. Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted August 31, 2011 Share Posted August 31, 2011 Well, as I said, I don't want it to point at an existing object in my scene, I want it to point at whatever position the scene is being looked at though the viewport. Ohh sorry. Totally missread. Maybe you can use viewTransform from http://www.sidefx.com/docs/houdini11.0/hom/hou/GeometryViewport in a python expression in a Null node to make it always positioned where the viewport is and then use the look-at pointing at that. Quote Link to comment Share on other sites More sharing options...
ehsan parizi Posted August 31, 2011 Share Posted August 31, 2011 (edited) just a suggestion (I don't know if it works!!): There's an output from global variables node in VEX SHOP! (I don't know how to get it in vopsop!) called _I (Direction from Eye) which give you a vector, which is a vector from eye to each point of the object, maybe you can use it if you can somehow bring it to vopsop! Edited August 31, 2011 by ehsan parizi Quote Link to comment Share on other sites More sharing options...
Zero Posted September 4, 2011 Author Share Posted September 4, 2011 I found the GeometryViewport interface just before reading Erik_JE's suggestion (thanks!) -- and I did manage to put together some expressions to get the rotation matrix of the viewport. It works, in the sense that I can orient an object to point at the viewport, the problem is, that when the user tumbles the viewport, the expression is not re-evaluated. If I re-cook the operator, the object turns to look at the viewport again, but it requires a re-cook. For now that's good enough, but I am considering looking into using the HDK to draw what I want in OpenGL. That should overcome this limitation and actually would also solve other issues I have with my current design. Thanks everyone for your suggestions! 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.