Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[SOLVED] vec_for_screen camera shaking #459664
05/30/16 12:04
05/30/16 12:04
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hi,

I use vec_for_screen to position several entities for the game interface.
But for some reason the vec_for_screen line in the code below results in that the entity constantly switches position a bit (as if it is a vibrator lol grin ). camera constantly changes position. crazy

Code:
while(1) {
vec_set(my.x, vector(50, 50, 0)); // x/y test values
my.z = 50; //depth
vec_for_screen(my.x, camera);
vec_set(my.pan, camera.pan);
wait(1);
}



Besides that shaking, the camera itself stands still by the way.
If I comment the line "vec_for_screen(my.x, camera);" out, the problem goes away. But I would like to use vec_for_screen obviously.

Last edited by Reconnoiter; 05/30/16 13:17.
Re: vec_for_screen camera shaking [Re: Reconnoiter] #459667
05/30/16 13:16
05/30/16 13:16
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Oh stupid me, the inventory slots were catched by a trace for the camera code. smirk
I will leave this thread here cause I quess its easy to make this mistake.

Last edited by Reconnoiter; 05/30/16 13:17.
Re: vec_for_screen camera shaking [Re: Reconnoiter] #459682
05/30/16 20:42
05/30/16 20:42
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
And for all beginners facing this problem,
Code:
c_ignore (...,0);

and
Code:
my.group

can help here ( besides PASSABLE and IGNORE_PASSABLE flags ).

Greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: vec_for_screen camera shaking [Re: rayp] #459688
05/31/16 09:34
05/31/16 09:34
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
I might as well give another tip now, you can use Define for 'groups' too to make your code cleaner and better readable, example:

Code:
//collision groups
#define ALLY_GROUP	1
#define ENEMY_GROUP	2
#define NATURE_GROUP	3
#define ITEM_GROUP	4

....
action squirrel() {
   my.group = NATURE_GROUP;
   ...
}

function convert_squirrels() {
   c_ignore(ALLY_GROUP, ITEM_GROUP, 0); //only enemies or nature
   if (c_trace(..., ..., ...) > 0) {
     if (you) you.group = ALLY_GROUP;
   }
}



Maybe a bit offtopic though grin

Last edited by Reconnoiter; 05/31/16 09:38.
Re: vec_for_screen camera shaking [Re: Reconnoiter] #459724
06/01/16 21:03
06/01/16 21:03
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Quote:
Maybe a bit offtopic though grin
Thats totally ok in this case of usefull well written script example!


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: vec_for_screen camera shaking [Re: rayp] #459744
06/02/16 16:11
06/02/16 16:11
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Originally Posted By: rayp
Quote:
Maybe a bit offtopic though grin
Thats totally ok in this case of usefull well written script example!
, tnx, I thought the addition of squirrels would really add something grin


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