[Solved] Displace along a world space position?
2733 2 1- Narann
- Member
- 8 posts
- Joined: April 2013
- Offline
Hi Houdini community.
I'm playing with with Houdini on my spare time trying to see what I can do.
I'm testing a kind of camera mapping stuff with different layers to create a kind of “deep”.
I apply a displace oriented to the camera start position (not the camera itself as it's moving) on each layer to give them a subtle deep effect and avoir a flat effect.
The rought effect I try to achieve is on the linked image.
I have a little problem and would like to have your opinion.
I use a VOP for displacement:
Displace_Global.Surface_Position -> Look_At.From_Position
Param (Vector 0, 0, 0) -> Look_At.To_position (0,0,0 for world space because my camera start at world space)
Look_At.matrix3 -> matrix3_to_matrix4
# I multiply the surface normal by the “oriented” matrix
Displace_Global.Surface_Normal -> Multiply
matrix3_to_matrix4 -> Multiply
# and put my oriented normal to the displace along normal.
Displace_Global.Surface_Position -> Displace_Along_Normal.position
Multiply.output -> Displace_Along_Normal.Normal
LookAt [sidefx.com]
Displace Along Normal [sidefx.com]
What is very strange is that is seems to work (displace seems to target a position) but it's as if my “world space” (0,0,0) was far behind my camera (displace don't point to 0,0,0 but something like 0,0,-10).
Sorry, I can't give you the file today as I'm not on my house by will send it asap.
Hope someone understand what I want to do.
Thanks in advance and have a good WE!
Regards,
Dorian
I'm playing with with Houdini on my spare time trying to see what I can do.
I'm testing a kind of camera mapping stuff with different layers to create a kind of “deep”.
I apply a displace oriented to the camera start position (not the camera itself as it's moving) on each layer to give them a subtle deep effect and avoir a flat effect.
The rought effect I try to achieve is on the linked image.
I have a little problem and would like to have your opinion.
I use a VOP for displacement:
Displace_Global.Surface_Position -> Look_At.From_Position
Param (Vector 0, 0, 0) -> Look_At.To_position (0,0,0 for world space because my camera start at world space)
Look_At.matrix3 -> matrix3_to_matrix4
# I multiply the surface normal by the “oriented” matrix
Displace_Global.Surface_Normal -> Multiply
matrix3_to_matrix4 -> Multiply
# and put my oriented normal to the displace along normal.
Displace_Global.Surface_Position -> Displace_Along_Normal.position
Multiply.output -> Displace_Along_Normal.Normal
LookAt [sidefx.com]
Displace Along Normal [sidefx.com]
What is very strange is that is seems to work (displace seems to target a position) but it's as if my “world space” (0,0,0) was far behind my camera (displace don't point to 0,0,0 but something like 0,0,-10).
Sorry, I can't give you the file today as I'm not on my house by will send it asap.
Hope someone understand what I want to do.
Thanks in advance and have a good WE!
Regards,
Dorian
Edited by - July 21, 2013 10:40:52
- tamte
- Member
- 8599 posts
- Joined: July 2007
- Online
even though I don't get much from your description of the process (the file would be better) I can see from your file that you just want the displacement to point towards some point in the world space
if that's correct then you can just transform the world space pos to camera space, subtract surface pos from it, normalize and you have the displacement direction you want
if that's correct then you can just transform the world space pos to camera space, subtract surface pos from it, normalize and you have the displacement direction you want
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Narann
- Member
- 8 posts
- Joined: April 2013
- Offline
-
- Quick Links