Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 622 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
C_Rotate (Reldist) #219930
08/05/08 17:21
08/05/08 17:21
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
C_rotate can be used to rotate an object, but it does not have any parameter to use if you want to rotate an object using reldist (relative distance).

USE_AXIS/R rotates VIA absdist (abstract distance or world co-ordinance) but there is none that rotates using reldist.

What can be done to use reldist co-ordinance instead?

Last edited by 82RJZAE; 08/06/08 16:50.
Re: C_Rotate (Reldist) [Re: 82RJZAE] #220193
08/06/08 11:37
08/06/08 11:37
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
USE_AXIS - does not rotate about world coordinates, but about the entities' coordinate system.

that's what says in manual, so i think you got your answer



Ubi bene, ibi Patria.
Re: C_Rotate (Reldist) [Re: croman] #220252
08/06/08 16:50
08/06/08 16:50
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Oh really? I read that "USE_AXIS" would rotate VIA the entity but for some reason it didn't work. Sorry then, must be something wrong with my code then.

Re: C_Rotate (Reldist) [Re: 82RJZAE] #220320
08/06/08 22:41
08/06/08 22:41
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
it should work, it worked for me. what engine version do you have?



Ubi bene, ibi Patria.
Re: C_Rotate (Reldist) [Re: croman] #220333
08/07/08 00:06
08/07/08 00:06
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
A7 Trial (7.10).
SED Trial (7.06.1).

Maybe a version issue?

Last edited by 82RJZAE; 08/07/08 00:07.
Re: C_Rotate (Reldist) [Re: 82RJZAE] #220413
08/07/08 10:15
08/07/08 10:15
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
hm...i cant tell if there's some kind of bug on 7.10 cause i have 7.07 and as i said it works on that version.
maybe something with your code is wrong. can you post that part of your code here?



Ubi bene, ibi Patria.
Re: C_Rotate (Reldist) [Re: croman] #220614
08/07/08 19:02
08/07/08 19:02
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Alright, here's a small part of code:

Code:
...

function player1() {
...

	ph_...(physics applied);
	phent_(type and mass = PH_BOX);
		while(1) {
			if(key_w) {
				phent_add...();
				}
			if(key_a) {
				phent_enable(me, 0);
				c_rotate(me, vector(time_step, 0, 0), USE_AXIS);
				phent_enable(me, 1);
				}
			}
	}

...

This allows the entity to advance forwards (dir x) but still moves the same direction even when it has rotated (not rotated by the reldist or Euler angles).

Re: C_Rotate (Reldist) [Re: 82RJZAE] #220632
08/07/08 22:20
08/07/08 22:20
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
i think that phent_enable causes that. try using phent_settype( me, 0, 0 ); then use c_rotate and then reanable it with phent_settype( me, PH_RIGID, PH_...);



Ubi bene, ibi Patria.
Re: C_Rotate (Reldist) [Re: croman] #220642
08/07/08 23:36
08/07/08 23:36
Joined: Jul 2008
Posts: 168
8
82RJZAE Offline OP
Member
82RJZAE  Offline OP
Member
8

Joined: Jul 2008
Posts: 168
Not quite sure what you mean, but this also occurs when c_move is used.
The entity is rotated by the Euler angles only when the reldist parameters are used in c_move.

"c_move(ENTITY* entity,VECTOR* reldist,VECTOR* absdist,var mode)"

Last edited by 82RJZAE; 08/07/08 23:37.
Re: C_Rotate (Reldist) [Re: 82RJZAE] #220644
08/07/08 23:51
08/07/08 23:51
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
why dont you use reldist then?



Ubi bene, ibi Patria.
Page 1 of 2 1 2

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

Gamestudio download | chip programmers | 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