Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Roll without changing my.z ... #367094
04/09/11 18:05
04/09/11 18:05
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Hi,

I make a entity do a 360 roll... but if i move this one on the y axis at same time i roll it make the entity changing his z axis.. according too the roll orientation.

So i dont want the roll affect any axis move... but i want it to roll according of the pan orientation of the entity.

How can i do that?

Re: Roll without changing my.z ... [Re: Altarius] #367098
04/09/11 20:12
04/09/11 20:12
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Well.... its imposible or my question are incomprehensible?

Last edited by Altarius; 04/09/11 20:12.
Re: Roll without changing my.z ... [Re: Altarius] #367099
04/09/11 20:38
04/09/11 20:38
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Probably the latter..?

Perhaps you should show us your code.

Last edited by Redeemer; 04/09/11 20:38.

Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: Roll without changing my.z ... [Re: Altarius] #367101
04/09/11 21:04
04/09/11 21:04
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Open your model in MED. How is the orentation of your model? Unless it is perfect center it will look to seem like it's moving around in a circle when spun. Thing of a ball on a string and spinning it around in a circle above your ahead. The center is your hand.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Roll without changing my.z ... [Re: FoxHound] #367163
04/10/11 15:29
04/10/11 15:29
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Ok there's a exemple :
----------------------------------------------------
my.pan += 3* (key_a - key_d) * time_step;
my.roll += 3* (key_d - key_a) * time_step;
speed.x += 3 * (key_w - key_s) * time_step;
speed.y += 3 * (key_z - key_c) * time_step;

c_move(my,speed,nullvector,IGNORE_PASSABLE|GLIDE)
----------------------------------------------------

When im moving on the X axis, if i change the .pan the entity now move following the pan angle... like a car...

Now there's my problem :
When im moving on the Y axis, if i change the .roll the entity now move up or down following the roll angle...

I dont want my entity to change his movement direction if i change roll angle when i move on the Y axis...I just want it to continue to move regardless the .roll angle.


Last edited by Altarius; 04/10/11 15:35.
Re: Roll without changing my.z ... [Re: Altarius] #367165
04/10/11 15:38
04/10/11 15:38
Joined: Mar 2010
Posts: 56
Hertfordshire, England
Panda_Dude Offline
Junior Member
Panda_Dude  Offline
Junior Member

Joined: Mar 2010
Posts: 56
Hertfordshire, England
so are you saying that the entity moves on the z axis only when its moving on the y axis and changing it's roll angle? Or does it appear to change on the z axis even when stationary on the y axis? If it does it while it's stationary then it has already been mentioned; the model is probably not centered properly.

Last edited by Panda_Dude; 04/10/11 15:39.
Re: Roll without changing my.z ... [Re: Panda_Dude] #367168
04/10/11 15:46
04/10/11 15:46
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
maybe you should use absolute and relative positions in combinition
i think that's your problem


Visit my site: www.masterq32.de
Re: Roll without changing my.z ... [Re: MasterQ32] #367202
04/10/11 19:30
04/10/11 19:30
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
One problem I see is that you constantly add to your move number. It should be speed.x = 3 ...
Next is the your character will move like a car. Forward. So when pan and roll are changed so is forward. So you are moving more like a plane or space ship. To solve your pRoblem use richi's idea and some playing around.

Another idea is to record your z position before the movement and then set your mesh back to the z position.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Roll without changing my.z ... [Re: FoxHound] #367232
04/11/11 02:52
04/11/11 02:52
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Yea i think u right Richi i need too combine both... but i have trying a lot of thing and that not work =(

Suppose i use directly-->

my.pan += 4 * (key_a - key_d) * time_step;
my.roll += 4 * (key_e - key_q) * time_step;
my.x += 8 * (key_w - key_s) * time_step;
my.y += 8 * (key_c - key_z) * time_step;

So now when i change my PAN, it dont affect the movement direction.

But if i want the PAN affect the direction using this code, what i need to add?

Re: Roll without changing my.z ... [Re: Altarius] #367233
04/11/11 02:59
04/11/11 02:59
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Use the other vector parameter of c_move, rotated around just your pan:
Code:
c_move(my, nullvector, vec_rotate(speed, vector(my.pan, 0, 0)), IGNORE_PASSABLE|GLIDE);

That's the quick and dirty version -- in the process "speed" gets modified to be the character's absolute speed, rather than relative speed, so if instead of assigning values to speed's parameters you want to do stuff gradually over time, you'll need another VECTOR so you can do vec_rotate without changing your speed VECTOR.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1