Help with your scripting

Orbital Camera + Mouse zoom

Orbital Camera + Mouse zoom

Postby planetX » 21 Feb 2018, 19:22

Hi there,

I'd like to implement a 360°orbital camera and a mouse-wheel zoom over an entity. Something like this example:

http://playground.babylonjs.com/#ZGU0A5

Is that possible with no pain? I have no idea where to start... :lol:

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Mage
 
Posts: 203
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer

Re: Orbital Camera + Mouse zoom

Postby SolarPortal » 21 Feb 2018, 19:48

Should be able too.. i'd have to have a look though and see it for myself, can't place it off the top of my head lol :P
Conceive, Quantify & Do!
Skyline Game Engine - Lead Developer.
Please provide as much information as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 3770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3071
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Orbital Camera + Mouse zoom

Postby SolarPortal » 21 Feb 2018, 19:56

Does it need to be scripted or can the camera already exist in the scene?

If so, then add a camera from right click.
* Check set active
* Change camera mode from Fly to orbit.
* Check the Lookat box
* Then enter the tag of the name to lookat.

Press play and using the RMB+hold, you can rotate around an object.
However, mine crashes on stop of the game.. but i was surprised at how quick it was.... and will fix this bug that has been found..
Could you open a ticket based on this found bug..


Edit: Bug is fixed :)
Conceive, Quantify & Do!
Skyline Game Engine - Lead Developer.
Please provide as much information as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 3770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3071
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Orbital Camera + Mouse zoom

Postby planetX » 21 Feb 2018, 22:27

Yeah, I can add a camera in the editor. I was playing with the Player Camera V2 and totally forgot the other camera. :? Orbit works and it doesn't crash here... there are however some glitches, like jumping from top to bottom suddenly. I can record a video if it helps.

Ok, this is a good start, I just need to solve the zoom. Could not find anything related to the mouse wheel in the API, any hint? The idea is moving the camera in the local Z axis with the mouse wheel.

Image

Thanks for having a look. ;)

My specs: Windows 10 - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 16 Gb ram DDR4 - NVIDIA GeForce GTX 960M 4 Gb

planetX
Skyline Mage
 
Posts: 203
Joined: 28 Nov 2016, 18:27
Skill: 3D Modeller
Skill: Level Designer
Skill: Concept artist
Skill: Great creative
Skill: Programmer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron