≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Smooth movement
Posted by:
(you are not logged in)
Enter the missing letter in: "Intern?tional"
(you are not logged in)
Text:
[quote][b]ddabrahim[/b] wrote: Hi. I would like to move a scene node left and right on the X axis. I'm using the code from the tutorial but I have noticed the movement is not smooth. What I mean, when I press a key down, the object move once then stop for a moment then continue the movement but the movement is a bit lumpy like the FPS would be low or the scene would be not rendered every frame. I tried to find a way to set FPS in CopperLicht but I didn't find anything in the doc, maybe I was looking the wrong place. However, inside CopperCube in the scene settings I did increase the max FPS to 60 and to redraw the screen every frame. But it didn't help. This is the code I'm using: [code] var player_speed = 1; var player_leftkey = 'A'; var player_rightkey = 'D'; engine.ingComplete = function() { var scene = engine.getScene(); if (scene) { playerSceneNode = scene.getSceneNodeFromName('player'); scene.setRedrawMode(CL3D.Scene.REDRAW_EVERY_FRAME); } } document. = function(event) { var key = String.fromCharCode(event.keyCode); if (key == player_leftkey && playerSceneNode) playerSceneNode.Pos.X += player_speed; if (key == player_rightkey && playerSceneNode) playerSceneNode.Pos.X -= player_speed; };[/code] Since, it seems like there is no physics to move anything, I don't know what else I could try. Any help on this would be appreciated. Thank you.[/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