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

Author Topic: Zoomed version of my enemy  (Read 878 times)

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Zoomed version of my enemy
« on: Jul 05, 13, 12:36:50 AM »

Let's say i am fighting my enemy at a large distance, and its model is represented by a couple of pixels. I would like to have a mini window which would show the zoomed version of my enemy. How would one implement that?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Zoomed version of my enemy
« Reply #1 on: Jul 05, 13, 01:16:13 AM »

A second camera can be set right near the model you are tracking. This view would be displayed in a small window, maybe with stats of model. The camera would jump to which target you were currently looking at. No matter how far away the model is, it would always be seen at the same size in the window. (a set distance from the model) The rotation would be based on your position. The camera would be on the same vector as you are to the model you are looking at. A value could show how far away the model is from you in the small window.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: Zoomed version of my enemy
« Reply #2 on: Jul 05, 13, 01:22:29 AM »

Do you perhaps know if there are some code examples lying around or wiki entries? Something i could start with?


Is it even possible to have second camera displaying at the same time as the main camera?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Zoomed version of my enemy
« Reply #3 on: Jul 05, 13, 06:17:35 AM »

With the cameras, one needs to be the "active" one, which gets displayed in the main viewport.  So, you would need a second viewport, which I am not sure if there is support for in the engine or not.

If you just want to show the character's model and not really a "live" shot of them, you can create a virtual stage and create a character in that stage from the character in the world:

Client-side external functions:
CopyCharacterIntoVirtualStage(original as NodeRef of Class HBNode, stagename as String) as NodeRef of Class HBNode
    Uses a character node in the world as the basis for copying.

CreateCharacterInVirtualStage(fqn as String, stage as String) as NodeRef of Class HBNode
    Creates a character in the stage from the path to its model in the repository.

CreateCharacterInVirtualStageFromOutfit(outfitHandle as ID, stageName as String) as ID
    Creates a character in the stage from an outfit passed from the server via external function SendCharacterOutfitToPlayer().

The view of the stage can then be shown on a gui panel by setting the panel's texture field to
    :stageName
where, of course, you would put the actual name of the stage in place of stageName.
« Last Edit: Jul 05, 13, 06:19:45 AM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: Zoomed version of my enemy
« Reply #4 on: Jul 05, 13, 01:40:34 PM »

Thanks! The virtual stage solution seems reasonable. I will check it out!
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Zoomed version of my enemy
« Reply #5 on: Jul 05, 13, 03:28:47 PM »

Are you trying to do alike a sniper scope effect? Or a binocular effect?

If so you can just translate your current players camera to the location by altering the offsets, of the camera from it's origin towards the model, OR you can flip it change the camera to be locked onto the target and then offset it by a certain amount, towards your player, with the camera rotated to the object.

If you are trying to do two totally different views at the same time, not sure, cause as mentioned HE likes to have an active layer, in the view port.

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

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: Zoomed version of my enemy
« Reply #6 on: Jul 05, 13, 04:47:04 PM »

I'm trying either two totally different camera views at the same time, or any kind of an alternative to "render to texture" which i couldn't find anything about in the wiki, so i'd assume it's doesnt exist, or?

To be more precise, i'll use an example from EVE online. I want to have targets like in the picture below (marked with red ellipse), but instead of icons, i want to have a live camera feed.

« Last Edit: Jul 05, 13, 04:58:39 PM by AWW_boss »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Zoomed version of my enemy
« Reply #7 on: Jul 05, 13, 05:18:35 PM »

I have not worked with the minimap much to know really how that rendering works, but perhaps you could use that and have it somehow focused on the target.

You could see if that would work and if there can be multiple minimaps on screen at a time.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.