Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: How to move 3d objects using mouse in real tim [Re: tex] #205545
05/07/08 07:57
05/07/08 07:57
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Try replace :

eBall.x= (camera.x+cos(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt)));
eBall.y= -1*(camera.y+sin(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt)));
eBall.z= (camera.z+sin(cam_ang.tilt)*cam_dist);

to

vec_set(eBall.x,cam_dist.x);
vec_rotate(eBall.x,camera.pan);
vec_add(eBall.x,camera.x);
vec_set(eBall.pan,camera.pan);

Not tested btw.


Last edited by vlau; 05/07/08 07:58.
Re: How to move 3d objects using mouse in real tim [Re: vlau] #205689
05/08/08 00:09
05/08/08 00:09
Joined: Apr 2008
Posts: 15
Oz
T
tex Offline OP
Newbie
tex  Offline OP
Newbie
T

Joined: Apr 2008
Posts: 15
Oz
Thanx Vlau

Unfortunately:

vec_set(eBall.x,cam_dist.x);
vec_rotate(eBall.x,camera.pan);
vec_add(eBall.x,camera.x);
vec_set(eBall.pan,camera.pan);

doesn't seem to work.

cam_dist is a var so only has one value not x, y, z. Although it would be possible to define separate values for each of these.

I think the problem is not with updating the position coordinates for eBall but its orientation. Not sure how to get this and pass it to eBall after executing the orbit function...

will try something else now...

Page 2 of 2 1 2

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