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 (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 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 2 of 3 1 2 3
Re: scale not affecting physics box [Re: croman] #220473
08/07/08 11:27
08/07/08 11:27
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Sure: (Top to bottom now)

=================================================================================

///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////////////////////////////////////

VECTOR ball_speed;
VECTOR Temp;
ENTITY* ball;
ENTITY* Slab;

function main()
{
fps_max = 200;
level_load("roller.wmb"); // load the level
wait (2); // wait until the level is loaded
ball = ent_create ("ball.mdl", vector(-400, 0, 100), NULL); // create the ball
ph_setgravity (vector(0, 0, -426)); // set the gravity
phent_settype (ball, PH_RIGID, PH_SPHERE); // set the physics entity type
phent_setmass (ball, 3, PH_SPHERE); // and its mass
phent_setfriction (ball, 199); // set the friction
phent_setdamping (ball, 20, 20); // set the damping
phent_setelasticity (ball, 20, 5); // set the elasticity
Slab = ent_create ("Slab.mdl", vector(-400, 0, 100), NULL); // create the ball
phent_settype (Slab, PH_RIGID, PH_BOX); // set the physics entity type
phent_setmass (Slab, 1, PH_BOX); // and its mass
phent_setfriction (Slab, 199); // set the friction
phent_setdamping (Slab, 20, 20); // set the damping
phent_setelasticity (Slab, 90, 5); // set the elasticity
phent_settype (Slab, 0 , 0); // set the physics entity type
Slab.scale_x = 5;
Slab.scale_y = 5;
Slab.scale_z = 5;
wait (1);
c_setminmax(Slab);
phent_settype (Slab, PH_RIGID, PH_BOX); // set the physics entity type

while (1)
{
ball_speed.x = 35 * (key_cur - key_cul); // move the ball using the cursor keys
ball_speed.y = 35 * (key_cuu - key_cud); // 25 sets the x / y movement speeds
ball_speed.z = 0; // no need to move on the vertical axis
phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball
//camera.x = ball.x - 400; // keep the camera 300 quants behind the ball
//camera.y = ball.y; // using the same y with the ball
//camera.z = ball.z + 100; // and place it at z = 1000 quants
//camera.tilt = -5; // make it look downwards
camera.x = 500;
camera.y = 500;
camera.z = 500;
vec_set(Temp,ball);
vec_sub(Temp,camera);
vec_to_angle( camera.pan ,Temp); // now MY looks at YOU
wait (1);

}
}
=================================================================================


I am a noob to this... Blitz3D is where i am best at!
Re: scale not affecting physics box [Re: CdeathJD] #220474
08/07/08 11:30
08/07/08 11:30
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
maybe you didnt disable physics or you didnt make it good.



Ubi bene, ibi Patria.
Re: scale not affecting physics box [Re: croman] #220478
08/07/08 11:34
08/07/08 11:34
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
What has disabling physics got to do with pointing one object at another? I dont understand what you are saying. Also... i dont find "didn't make it good" a very helpful comment really!

Though to be honest i didnt make most of it i just changed it and fiddled with it!


I am a noob to this... Blitz3D is where i am best at!
Re: scale not affecting physics box [Re: CdeathJD] #220479
08/07/08 11:38
08/07/08 11:38
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
Replace this:
vec_set(Temp,ball);
vec_sub(Temp,camera);
vec_to_angle( camera.pan ,Temp);

with this:
Add new var "camera_rot"

vec_set(camera_rot,ball.x);
vec_sub(camera_rot,camera.x);
vec_to_angle( camera.pan ,camera_rot);

Last edited by cro_games; 08/07/08 11:40.

Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: scale not affecting physics box [Re: CdeathJD] #220480
08/07/08 11:38
08/07/08 11:38
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
edit:::damn it, i'm so stupid. lol i didnt see it right. i'm tired that's why i told you that lol

Last edited by cerberi_croman; 08/07/08 11:42. Reason: i'm tired so i made a mistake hehe


Ubi bene, ibi Patria.
Re: scale not affecting physics box [Re: croman] #220483
08/07/08 11:42
08/07/08 11:42
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Yes but im not trying to "point" the ball. I'm trying to point the "camera" at the ball. Would i still need to disable physics on any object i wished to point another object at?


I am a noob to this... Blitz3D is where i am best at!
Re: scale not affecting physics box [Re: CdeathJD] #220484
08/07/08 11:45
08/07/08 11:45
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
no!
Replace this:
vec_set(Temp,ball);
vec_sub(Temp,camera);
vec_to_angle( camera.pan ,Temp);

with this:
Add new var "camera_rot"

vec_set(camera_rot,ball.x);
vec_sub(camera_rot,camera.x);
vec_to_angle( camera.pan ,camera_rot);


Last edited by cro_games; 08/07/08 11:45.

Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: scale not affecting physics box [Re: croman] #220485
08/07/08 11:45
08/07/08 11:45
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Originally Posted By: cerberi_croman
edit:::damn it, i'm so stupid. lol i didnt see it right. i'm tired that's why i told you that lol


Go to bed then... the world wont end because i failed to learn this skill today!


I am a noob to this... Blitz3D is where i am best at!
Re: scale not affecting physics box [Re: cro_games] #220497
08/07/08 12:11
08/07/08 12:11
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Originally Posted By: cro_games
no!
Replace this:
vec_set(Temp,ball);
vec_sub(Temp,camera);
vec_to_angle( camera.pan ,Temp);

with this:
Add new var "camera_rot"

vec_set(camera_rot,ball.x);
vec_sub(camera_rot,camera.x);
vec_to_angle( camera.pan ,camera_rot);


That worked thanks!!!

Why on earth is the ".x" necessary though... its not just taking the X vector into account but all of them :S!


I am a noob to this... Blitz3D is where i am best at!
Re: scale not affecting physics box [Re: CdeathJD] #220499
08/07/08 12:18
08/07/08 12:18
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
No,problem is that "Temp" can be only use in the action..


Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Page 2 of 3 1 2 3

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