Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,512 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bone camera #300217
11/30/09 15:48
11/30/09 15:48
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline OP
Member
Blackchuck  Offline OP
Member
B

Joined: Jul 2009
Posts: 150
HY.
So I know how to use bones, but is it passable to set the camera on a bone?
I meen it like this;
Link

Here is one of my tryes;
_______________________________________________________________

function move_bone();

ANGLE bone_angle;
var run_speed;

function main()
{
video_mode=8;
video_screen=1;
video_depth=32;
level_load ("");
ent_create("dummy.mdl", vector(400, 0, -50), move_bone);
mouse_mode = 4;
}

function move_bone()
{
player = me;
while(player)
{
run_speed += 5 * time_step;
ent_animate(my, "run", run_speed, ANM_CYCLE);
bone_angle.pan = (mouse_pos.x - screen_size.x / 2) / 15;
bone_angle.tilt = (screen_size.y / 2 - mouse_pos.y) / 20;
bone_angle.roll = 0;
ent_bonereset(my,"Head");
ent_bonerotate(my,"Head", bone_angle);
wait(1);
}
ent_bonereset(my,"eye");
camera = ent_bonereset(my,"eye");
}


I have know Gamestudio/A7 Commercial Edition 7.84
Re: bone camera [Re: Blackchuck] #300223
11/30/09 16:26
11/30/09 16:26
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
This won't work like this.
I think the easiest method would be using.
vec_for_bone(VECTOR*,ENTITY*,STRING*)
This way you can set the camera position.
You can use ang_for_bone(ANGLE*,ENTITY*,STRING*) to get the head angles.
I think you have to tilt + 90° in order to rotate the camera correctly.


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: bone camera [Re: Puppeteer] #300227
11/30/09 16:53
11/30/09 16:53
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline OP
Member
Blackchuck  Offline OP
Member
B

Joined: Jul 2009
Posts: 150
like this?;

function move_bone()
{
player = me;
while(player)
{
run_speed += 5 * time_step;
ent_animate(my, "run", run_speed, ANM_CYCLE);
bone_angle.pan = (mouse_pos.x - screen_size.x / 2) / 15;
bone_angle.tilt = (screen_size.y / 2 - mouse_pos.y) / 20;
bone_angle.roll = 0;
ent_bonereset(my,"Head");
ent_bonerotate(my,"Head", bone_angle);
wait(1);
vec_for_bone(camera.x, my, "eye");
ang_for_bone(camera.pan, my, "eye");
}
}


I have know Gamestudio/A7 Commercial Edition 7.84
Re: bone camera [Re: Blackchuck] #300258
11/30/09 21:09
11/30/09 21:09
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline OP
Member
Blackchuck  Offline OP
Member
B

Joined: Jul 2009
Posts: 150
yes, it works fine.
Thanks for the tipp Puppeteer!


I have know Gamestudio/A7 Commercial Edition 7.84

Moderated by  HeelX, Spirit 

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