Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / move a 3d object

Author
Message
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 9th Jun 2020 09:19
good morning .... please, could someone give me some guidance on how to move a 3d object at a certain angle?
for example a shot, a missile etc ...

I already have a character that I move, as I want in the 3d world, but when I spawn a shoot, I can't get it to move as it should

I have not found how to make an advance function and my knowledge in mathematics is not helping

or indicate any code that has been published in this regard .... the searches that I have made lead me only to the darkbasic forum

thx!!!!
using AppGameKit V2 tier 1
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th Jun 2020 10:23
Perhaps you could post the code you have tried and we can point out what you could do to improve it?
Also, you say you have working 3D movement for your character, so if you post this then we can demonstrate how to adapt that code for your missiles.
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 9th Jun 2020 11:27
okay. I am going to rewrite the function that moves the shots since since it did not work I have deleted it. the movement of the character that I do is very simple
this code to move


and this function repositions the camera and rotates the character pointing in the direction of the pointer




i found this https://forum.thegamecreators.com/thread/222027#msg2626744
but this uses fisycs.

As you can see I do not use physics in the game.
I used trigonometry to move the shot but frankly it had nothing to do with what I was trying
a simple orientation that guides me in the right direction I hope is enough, or a code that you have used in a similar situation without physics

very thx
using AppGameKit V2 tier 1
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 9th Jun 2020 11:57
I upload a small demo in case it can be of help to understand what I want to achieve
using AppGameKit V2 tier 1

Attachments

Login to view attachments
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 9th Jun 2020 11:58 Edited at: 9th Jun 2020 11:59
ups... i cant upload a zip file?

edit: ok is here
using AppGameKit V2 tier 1
Mambazo
18
Years of Service
User Offline
Joined: 11th Dec 2005
Location:
Posted: 9th Jun 2020 13:15
Would these functions be helpful?

MoveObjectLocalX()
MoveObjectLocalY()
MoveObjectLocalZ()

If at first you don't succeed, sky-diving isn't for you.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 9th Jun 2020 13:47
yes as mambazo says you normally just rotate the object to face the same direction as the camera/gun then move it forwards
i.e.
SetObjectRotation(obj,GetCameraAngleX(1),GetCameraAngleY(1),GetCameraAngleZ(1))
MoveObjectLocalZ(obj,distance)
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
pamercomov
FPSC Reloaded TGC Backer
9
Years of Service
User Offline
Joined: 2nd Jan 2015
Location: palma de mallorca
Posted: 9th Jun 2020 16:03
ooohh...thx,
This is what I was looking for and I had not found and I was going crazy with math and it was done ..... very very thx
using AppGameKit V2 tier 1

Login to post a reply

Server time is: 2024-11-22 04:56:19
Your offset time is: 2024-11-22 04:56:19