Jump to content

Lookat In Sop Level


RickWork

Recommended Posts

Hello,

Could you have gotten the normalof each of these points and "aim" them to the point to which you are trying to aim at?

i.e.:

tx = $TX-point("../lookAtPt", 0, "P", 0)

ty = $TY-point("../lookAtPt", 0, "P", 1)

tz = $TZ-point("../lookAtPt", 0, "P", 2)

This will allow your boxes to aim at that lookat point when you copy them to the point where its normal is looking. You might also want to set an up vector to those aim points to prevent flipping tho.

HTH,

Alex

Link to comment
Share on other sites

I don't think that'll work becuae alll the copies have the same orientation

24987[/snapback]

Yeah I'm with Alex on this one -- set your point normals and up vectors on your copy SOP's template geometry, then copy w/ "rotate to normals" on... you can object merge your camera into the SOP network and use a point SOP to subtract the point position on the camera from your template's point positions, that should give you vectors pointing at the camera...

Link to comment
Share on other sites

Actually I spoke to soon.

It seems that the objects can't look behind them, only infront of them when using a copy sop.

I tried this with a single point and it works just fine as I expect but once I use a copySOP, the normals can all only point one way for orientation?

Can anybody help here?

I've attached a file where I try to orient the copys based on their relative position.

Thanks!

/Rick

RW_LookAT.hip

Link to comment
Share on other sites

Actually I spoke to soon.

It seems that the objects can't look behind them, only infront of them when using a copy sop.

I tried this with a single point and it works just fine as I expect but once I use a copySOP, the normals can all only point one way for orientation?

Can anybody help here?

I've attached a file where I try to orient the copys based on their relative position.

Thanks!

/Rick

25156[/snapback]

One thing I spotted right away is the expressions in your point SOP, I changed:

$TX+($TX2-$TX)

to

($TX2-$TX)

and that changed everything...

Another problem I think you're having is that you're copying that grid of points to your incoming null object, and it's the same scale -- your grid of points is "looking at" another grid of points that's just offset in space a little, hence the normals your computing are all parallel. Simplest fix would be to scale the grid down to zero before it's wired into your copy SOP, then all your normals will be converging on one single target...

Here's your .hip file back with a few slight tweaks, is this more what you want?

-JS-

RW_LookAT.2.hip

Link to comment
Share on other sites

haha I'm having some day or rather a mind trick on this.

Once again I thought I had it but didn't.

The problem with $TX2-$TX is that all the copies look at the null at the same time rather than with an offset of their relative position. Know what I mean?

When I do this this operation in say maya, each object will turn to look at the null from their initial position so there will be a random look to them.

So I thought I had it fixed in the fille I attached above called "working" but negating the expression if the values were negative but that wasn't it. yep, I'm confused.

Link to comment
Share on other sites

haha I'm having some day or rather a mind trick on this.

Once again I thought I had it but didn't.

The problem with $TX2-$TX is that all the copies look at the null at the same time rather than with an offset of their relative position. Know what I mean?

When I do this this operation in say maya, each object will turn to look at the null from their initial position so there will be a random look to them.

So I thought I had it fixed in the fille I attached above called "working" but negating the expression if the values were negative but that wasn't it. yep, I'm confused.

25160[/snapback]

Ohhh, I thought you didn't want that effect... I'm sort of confused as well... I'm quite sure that what you're looking for can be done, but I don't quite get what you're after. So you don't want all the copies to be aimed at a single point in space? Do you want them all to be parallel to each other and all aiming together in the direction of the target object? And I'm not sure why the copies wouldn't turn to look behind them (as long as the target object was behind them), but again I might not be understanding what you're looking for...

Link to comment
Share on other sites

you know what....

I had to just walk away from the computer and take a brain break. You are absolutly right. My mistake sorry.

The file you posted is exactly what I wanted.

What I was thinking was to have the guys way out in the distance falloff, like have them adjust their position at 1/2 the speed they normally would if they were say 5 units away from the null. I guess I can use the pointdist function for this.

Thanks and sorry again for the mix up.

/Rick

Link to comment
Share on other sites

What I was thinking was to have the guys way out in the distance falloff, like have them adjust their position at 1/2 the speed they normally would if they were say 5 units away from the null. I guess I can use the pointdist function for this.

25163[/snapback]

Ohhh OK, gotcha... well having those copies change their orientations at different speeds is another thing entirely... a lot more complex, but it can certainly be done, no problem... you'd probably need to pipe your source points and your target position into CHOPs, where you can do some work on the channels, like adding lag and stuff...

Link to comment
Share on other sites

Hello,

Sorry to bring this up again but I've been racking my brain on this for about 2 weeks.

How would I go about's decreasing this effect over distance and time from a point (like 1 frame and 1 unit) or something like that.

Essentially I would like to have each point aim at a null 1 after the other based on how far they are from a certain point.

I did try creating an attribute called DIST which is the distance from each point to a sphere in the scene. I'm using the pointdist() function. What I wanted is as the sphere is closer to some points on my grid, I would like this "aiming" to the null to happen and as the sphere is further away from the grid points I want the effect fade off. Ideally I'm just looking to offsset the aim over space and time.

In my pointSOP I have the expression:

($TX2-$TX) / $DIST

But that doesn't "appear" to be working per point. In the spreadsheet I can see the $DIST attr evalute properly for each point so I'm confused why the above expression doesn't work.

I did look at the object chop to compute distance but I don't see how I could lag points based off of distance and time.

Thanks

Link to comment
Share on other sites

Hello,

Sorry to bring this up again but I've been racking my brain on this for about 2 weeks.

How would I go about's decreasing this effect over distance and time from a point (like 1 frame and 1 unit) or something like that.

Essentially I would like to have each point aim at a null 1 after the other based on how far they are from a certain point.

Thanks

25401[/snapback]

Hey Rick,

After reading your posts I came up with something that might be closer to what you need, but it still doesn't address time-based issues, only distance-based... I've attached a .hip file with comments on some of the SOPs, hope this helps!

-JS-

RW_LookAT.3.hip

  • Thanks 1
Link to comment
Share on other sites

Hey Rick,

  After reading your posts I came up with something that might be closer to what you need, but it still doesn't address time-based issues, only distance-based... I've attached a .hip file with comments on some of the SOPs, hope this helps!

-JS-

25477[/snapback]

Thanks man. I did come up with something close to what you have there. Except my expression are way way too long. Nice elegant and clean approach you have. Thanks very much!

/Rick

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...