Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
Camera Fx - with Textures, 2D-Overlays, .js only (no shaders)

j0linar
Registered User
Quote
2017-02-11 12:42:26

Hey folks, after i played around with coppercube and reshade i decided to recreate the optical vibe i got from it with a Texture based 2D Setup only.

🔎︎


Therefore all you see in the video was done by using 2D Overlays and a couple of scripts,


Special thx to just_in_case for explaining me the draw Resolution part.

https://youtu.be/89nPJHOJ7oU

On a sidenote i do plan to expand this with a zoom function, not sure where it will end up...


techno-valley
Registered User
Quote
2017-02-11 16:56:36

Nice


j0linar
Registered User
Quote
2017-02-11 21:55:58

thx, now i wasn`t really sure what to do with the zoom ... i knew i would be using N.Gebhardt (nikos) Camera Zoom By MouseWheel behavior as a base.

Didn`t expected to actually get it working the way i wanted :D but i did
and so here is the video

https://youtu.be/n3miw7orMdc

What i did to make the Camera Zoom By MouseWheel working with a mouse button was the following.


//// changed this
behavior_CameraZoomByMouseWheel.prototype.onMouseEvent = function(mouseEvent, mouseWheelDelta)
{
if (mouseEvent == 1)
{
// mouse wheel
this.targetZoomValue += mouseWheelDelta * this.ZoomSpeed;

if (this.targetZoomValue < this.MinZoom)
this.targetZoomValue = this.MinZoom;

if (this.targetZoomValue > this.MaxZoom)
this.targetZoomValue = this.MaxZoom;
}
}
//// to that
behavior_CameraZoomByMouseWheel.prototype.onMouseEvent = function(mouseEvent, mouseWheelDelta)
{
if (mouseEvent == 5)
{
// right mouse down
this.targetZoomValue -= mouseEvent * this.ZoomSpeed;

if (this.targetZoomValue > this.MinZoom)
this.targetZoomValue = this.MinZoom;

if (this.targetZoomValue > this.MaxZoom)
this.targetZoomValue = this.MaxZoom;
}
if (mouseEvent == 4)
{
// right mouse up
this.targetZoomValue += mouseEvent * this.ZoomSpeed;

if (this.targetZoomValue < this.MinZoom)
this.targetZoomValue = this.MinZoom;

if (this.targetZoomValue < this.MaxZoom)
this.targetZoomValue = this.MaxZoom;
}
}


Now what the code does is it simply zooms in when u hold down the right mouse button and zooms out as soon as u leave the right mouse button and as it takes zoomspeed in account the result looks smooth.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact