≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Any translational camera shake
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b][/b] wrote: [quote][b]Des[/b] wrote: Sakura can you pls show me how to use the get end point for camera shake, pls make it simple I'm not good at programming *smile*[/quote] [code]ccbRegisterOnFrameEvent(OnFrame); var frame = 0; var flag = true; function OnFrame() { if(frame >= 3) { frame = 0; flag = !flag; } var camera = ccbGetSceneNodeFromName("camera"); var pos = ccbGetSceneNodeProperty(camera, "Position"); var rot = ccbGetSceneNodeProperty(camera, "Rotation"); var endPoint = Sakura.GetEndPoint(pos, rot.x, rot.y + (flag ? 90: -90), 2); ccbSetSceneNodeProperty(camera, "Position", endPoint.x, pos.y, endPoint.z); var target = Sakura.GetEndPoint(endPoint, rot.x, rot.y, 100); ccbSetSceneNodeProperty(camera, "Target", target.x, target.y, target.z); frame++; }[/code] This is a simple camera shake that supports horizontal shake with no complicated formula. If you add some variables to control it, you can shake the screen when you need to, I hope you will like it. [img]https://i2.lensdump.com/i/ToLykQ.gif[/img][/quote]
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