HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: scopes / zooming function  (Read 1196 times)

WorldWideZ

  • World Owners
  • ****
  • Posts: 524
    • View Profile
    • World Wide Zed
scopes / zooming function
« on: Dec 20, 13, 09:21:21 AM »

Has any body tried making a scope ?

I was wondering what solutions people had . Personally i have been working with the zoom external function , but that seems to offset the camera and thus go through solid objects. i have combined it with a per frame raycast to adjust it in line with he objects surrounding , but it doesnt feel right , especially over 10 meters.

Any one have any ideas for me to try on this?
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: scopes / zooming function
« Reply #1 on: Dec 20, 13, 09:25:47 AM »

Just making sure we on same page.
Your using the client side only zoom function right.
Cause it doesn't actually offset the position of the camera. Just want to make sure we talking apples since you mentioned external zoom function. Want to make sure we talking same one.

Quote
Zoom


Zoom(cameraName as string, amount as float, time as float, curve as string)
This function tells the camera to zoom forward or backward in local space, the distance specified by amount. Forward motion is accomplished with a positive amount, while backward motion is accomplished with a negative amount. While this changes the camera?s perspective, it does not actually change the camera?s position property. The camera will zoom in or out over the specified period of time, using the same curve parameters as used in LookAtNext().
Zoom("NAME", 0.5, 1.0, "SMOOTH")


GetZoom(name as string) as float
Returns the amount of zoom.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

WorldWideZ

  • World Owners
  • ****
  • Posts: 524
    • View Profile
    • World Wide Zed
Re: scopes / zooming function
« Reply #2 on: Dec 20, 13, 09:30:11 AM »

yep that function
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: scopes / zooming function
« Reply #3 on: Dec 20, 13, 11:32:00 AM »

so can the user move the camera / pan it while in zoom mode or is it more of locked to barely moving deals? Guess more like a prone position FPS scope, or more of a old timey telescope effect?

I ask, cause you could probably do one raycast at zoom time, check if it hits an object, if it does adjust the zoom factor to match that distance, assuming it's shorter than max scope.

The challenge though will be with panning the zoom around the area. Could be the check into the pan call, so that while panning it's making the check. One thing you could do is a bit of game magic, and do a mild jolt effect to the camera when it's moved, this can simulate moving the camera and then rehoning. At the end of the pan have it recalculate the distance to target hit and adjust the zoom to that level.

Would have to play around with some thoughts on this though. See what works best. Ideally a zoomed camera would still follow building occlusion / line of sight obstructions, but from what you are saying it doesn't
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]