Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
move into facing direction (plane)

andgameplay
Registered User
Quote
2022-07-28 21:23:29

Hello guys!

I'm trying to create a system to control an airplane using only the keys for the movements, without having to use the mouse.

How it works:

Every few seconds do something: move by vector into facing direction OK

A key: rotate by rotation (to go left) OK

D key: rotate by rotation (to go right) OK

the plane fly forward and turn left and right ok, but the problem is to rotate to up and down, I tryed:

W key: rotate by rotation (to go down)

S key: rotate by rotation (to go up)

The plane go down and up ok, but when I try to turn left or right with A or D key and try to go up or down again, the directions of the plane change, so the plane rotate wrong!

Any idea? Thanks!


Follow the file:

https://drive.google.com/file/d/...


VP
Guest
Quote
2022-07-28 21:58:38

The way I do this is: rather than try to apply all the movements and rotations to the aeroplane-model,simply attach the model to a dummy-node - then you can move/rotate the model and the dummy-node independently of each other.

1- Child the aeroplane-model to a dummy-node.
2- Move the dummy-node left right/up down.
3- Rotate the aeroplane model left/right forward/back.


andgameplay
Registered User
Quote
2022-07-29 02:51:21

Hi VP, thanks for your help! I tryed to do this, but each node just execute your own movement, the child node is not transfering the movement to the father node. To seem so simple, but is hard to make all to work together lol


sulbcon
Registered User
Quote
2022-07-30 00:30:42

Best advice is... Learn CCB JavaScript, It would make alot if things easier...


VP
Guest
Quote
2022-07-30 13:42:54

You're welcome, Have you tried this? It is confusing but it should work....

Child the model_node to the parent dummy_node.
Set the child model_node position to 0,0,0 (centre of the parent dummy node)

A key pressed: rotate by rotation dummy_node
will rotate the dummy_node (and the child_node)

D key pressed: rotate by rotation dummy_node
will rotate the dummy_node (and the child_node)

W key pressed: absolute rotation child_node 0,0,30
will rotate the child_node (but not the dummy_node)

W key released: absolute rotation child_node 0,0,0
will rotate the child_node 0,0,0 relative to the dummy_node

S key pressed: absolute rotation child_node 0,0,-30
will rotate the child_node (but not the dummy_node)

S key released: absolute rotation child_node 0,0,0
will rotate the child_node 0,0,0 relative to the dummy_node

Also, ensure you right click the child model_node and right-click to "Center pivot point", in case the model center is off.


andgameplay
Registered User
Quote
2022-07-30 23:29:26

Thanks again VP, I will try to do this, I think, it should work!


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