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

Author Topic: Advanced Linear Interpolation Camera  (Read 3735 times)

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Advanced Linear Interpolation Camera
« on: Jun 22, 12, 02:44:42 PM »

We used to just expect users to make their own camera system after replacing the simple game camera we have in the HeroCloud, but enough developers asked for a more advanced camera that we put one in by default in new HeroCloud Templates.

Here is the wiki entry for how to implement this Advanced Game Camera in your own world.
http://wiki.heroengine.com/wiki/Example_Advanced_Camera

Please note that all new HeroCloud Template worlds created as of the HeroEngine 1 Topaz release, have this advanced camera implemented by default.
« Last Edit: Dec 11, 12, 10:20:10 AM by HE-Cooper »
Logged

deiterate

  • World Owners
  • ****
  • Posts: 5
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #1 on: Jun 22, 12, 09:24:18 PM »

I'm certain this will help many developers who are still trying to wrap their mind around how the camera interfaces with the rest of the engine.

Awesome and thank you!

:D
Logged

Ascend2Crux

  • World Owners
  • ****
  • Posts: 29
    • View Profile
    • Ascend 2 Crux
Re: Advanced Linear Interpolation Camera
« Reply #2 on: Jun 23, 12, 01:38:38 AM »

Agreed anything and everything you guys do that makes it easier to see how HE works and fits together gives us more choices to design or build upon is fantastic.

That puts us another step closer to market.

MJ Trottier

Ascend 2 Crux




Know Vision Studios
Logged
Ascend 2 Crux where everything is player made.

AtlasCook

  • General Accounts
  • *
  • Posts: 16
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #3 on: Jul 02, 12, 10:31:00 AM »

Thank you for the easy WIKI tutorial!
The new LERP camera is unbelievably smooth!  ;D
Logged

PRatliff

  • World Owners
  • ****
  • Posts: 14
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #4 on: Jul 02, 12, 12:06:52 PM »

Anyone have a video of this LERP implementation? I'm curious to see how the smoothing looks.
Logged

JoshHalls

  • Founding Professional
  • *****
  • Posts: 335
    • View Profile
    • The Repopulation
Re: Advanced Linear Interpolation Camera
« Reply #5 on: Jul 03, 12, 01:12:56 AM »

Just ran into this, thanks Cooper as we needed to tackle this at one point, some time saved there.

--Josh
Logged
Co-Owner/Programmer - The Repopulation

DragonFist

  • General Accounts
  • *
  • Posts: 140
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #6 on: Jul 03, 12, 03:33:32 AM »

Anyone have a video of this LERP implementation? I'm curious to see how the smoothing looks.

I'm uploading a short one to youtube now.  I'm using it in First Person but I'm guessing it will answer your question.  I'll post a link either when it is done or tomorrow because I went to sleep before it was.

Edit: not done as this moment but I have the link so here you go, should be good in a few minutes:

http://youtu.be/GCHhSzbHydI

« Last Edit: Jul 03, 12, 03:52:43 AM by DragonFist »
Logged

DragonFist

  • General Accounts
  • *
  • Posts: 140
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #7 on: Jul 04, 12, 07:33:31 AM »

Finished my two over the shoulder cameras and did a video (short) in case that is of interest:

http://youtu.be/NyKBS1mLkeY

Logged

PN-Dwight

  • General Accounts
  • *
  • Posts: 465
    • View Profile
    • Pirates' Nest
Re: Advanced Linear Interpolation Camera
« Reply #8 on: Jul 04, 12, 07:59:57 AM »

Brian's work for the upcoming 2 weeks is to implement the camera system that you have built right there into our world.

It would really help our team, and most likely some others too, if you could share your implementation? I always found an over-the-shoulder camera the best camera for shooting purposes :)

DragonFist

  • General Accounts
  • *
  • Posts: 140
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #9 on: Jul 04, 12, 03:32:21 PM »

Brian's work for the upcoming 2 weeks is to implement the camera system that you have built right there into our world.

It would really help our team, and most likely some others too, if you could share your implementation? I always found an over-the-shoulder camera the best camera for shooting purposes :)

Sure, I'd have no problem doing that.  I'll start a different thread and it will probably be after I finish 4th of July celebrating.
Logged

DragonFist

  • General Accounts
  • *
  • Posts: 140
    • View Profile
Re: Advanced Linear Interpolation Camera
« Reply #10 on: Jul 04, 12, 04:16:00 PM »

Actually, I'll probably still post a semi step-by-step tutorial type post, but the majority of what your guy needs to know is probably in the code below:


function SetupOS_Camera()
  
camera as NodeRef AddCamera("GAME")
  if 
not (camera is kindof ADV_LerpCamera)
    
GlomClass"ADV_LerpCamera"camera )
  .
 
  
character as NodeRef of Class HBNode GetPlayerCharacterNode()
  
character_position as Vector3
  GetNodePosition
charactercharacter_position )
  
//character_position.y = character_position.y + 5.0;
  
SetCameraPosition"GAME"character_position )
  
character["Render"] = true
//  character["Render"] = false
 
  
SetCameraFollow"GAME",character )
    
  
gco as Float GetCameraOffset("*")
  if (
getCMDState("Camera","LeftShoulderModeEngaged"))
    
hOffset as Float 0.45 
    SetHorizontalCenterOffset
("GAME"hOffset)
    
character_position.character_position.25.0;
    
//LookAt("GAME", character, character_position)
    
if character <> None
      ACCController 
as NodeRef of Class _ACCController
      ro 
as Vector3
      
      where character is kindof _ACCControllerOwner
        ACCController 
character._getACCController()

        if 
ACCController <> None
          ro
.22
          ACCController
._setGameCameraRotationalOffset(ro)
        .
      .      
    .
  else
    
hOffset as Float = -0.5 
    SetHorizontalCenterOffset
("GAME"hOffset)
    
character_position.character_position.25.0;
   
// LookAt("GAME", character, character_position)
    
if character <> None
      ACCController 
as NodeRef of Class _ACCController
      ro 
as Vector3
      
      where character is kindof _ACCControllerOwner
        ACCController 
character._getACCController()

        if 
ACCController <> None
          ro
.= -22
          ACCController
._setGameCameraRotationalOffset(ro)
        .
      .      
    .
  
  .
  
 
  
  
FreeLook"GAME"true )
  
ActivateCamera"GAME")
  
SetCmdState("Camera","FirstPersonCameraEngaged",false)
  
SetCmdState("Camera","OverShoulderCameraEngaged",true)
  
//SetIgnoreCursor(true)
.
« Last Edit: Jul 04, 12, 04:21:17 PM by DragonFist »
Logged