3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
tilt + rotation [Fixed]
#261495
04/17/09 21:39
04/17/09 21:39
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Hello, As I've tried several things with Vec_for_vertex, however, it doesn't do what I want to do! I want to let an entity rotate around its own axis or how you want to call it. Here is a sample movie, made within SketchUp, but I need to get the same in 3DGS: http://www.youtube.com/watch?v=6803YrCNwNYAs you can see, the main platform aswell as the 4 satelites rotate while being tilted! How to archief this kind of rotation within 3DGS WITH physics enabled?
Last edited by Dreher; 04/22/09 10:07.
A7 7.77
|
|
|
Re: tilt + rotation
[Re: XD1v0]
#261537
04/18/09 11:32
04/18/09 11:32
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Not sure yet, I will check it out within the next 15 minutes, I am downstairs for the moment, I will let you know by editing this post! Oh, I can't run the script, the level just won't show up (But it doesn't give any errors too) And the fun_sp you mean the main platform? ^^ Woo, I really have a hard time getting this to work lol.. O_O EDIT3: Nah, this is too much for me.. I keep getting errors and when I fixed them, nothing will rotate and the main platform got back horizontally again while I had it set to 7 deg (Which was the only entity that worked, just the satelites wouldn't work the way I need them to be
Last edited by Dreher; 04/18/09 12:41.
A7 7.77
|
|
|
Re: tilt + rotation
[Re: XD1v0]
#261609
04/18/09 20:21
04/18/09 20:21
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
I use Lite-C, but I was using it in combination with ent_create etc.
I wasn't using it in WED, as in building the model there, so it might work afterall (If it isn't C-Script ^^)
But first I have to find a way how to use some sort of Vec_for_vertex within WED actions ^
A7 7.77
|
|
|
Re: tilt + rotation
[Re: Dreher]
#261614
04/18/09 20:45
04/18/09 20:45
|
Joined: Jun 2008
Posts: 151 Ukraine
XD1v0
Member
|
Member
Joined: Jun 2008
Posts: 151
Ukraine
|
I don't write on C-script usualy and previous code was in Lite-c. There is code, it run without map. So if this code dont work i must go mad
#include <acknex.h>
#include <default.c>
ENTITY* molen_arm;
var gcon;
action swing_gondela ()
{
my.scale_x=8;my.scale_y=8;
phent_settype (my,PH_RIGID,PH_BOX);
phent_setmass(my,1,PH_SPHERE);
gcon = phcon_add(PH_HINGE,my,NULL);
phcon_setparams1(gcon,my.x,vector(0,0,1),nullvector);
phcon_setparams2(gcon,vector(-360,360,0),nullvector,nullvector);
molen_arm = my;
}
action molen ()
{
var con;
while(molen_arm==NULL) {wait(1);}
phent_settype (my,PH_RIGID,PH_SPHERE);
phent_setmass(my,1,PH_SPHERE);
con = phcon_add(PH_HINGE,my,molen_arm);
phcon_setparams1(con,my.x,vector(0,0,1),nullvector);
phcon_setparams2(con,vector(-360,360,0),nullvector,nullvector);
phcon_setmotor (con,vector(3,10,0),nullvector,nullvector);
}
function main ()
{
level_load ("");wait(3);
ent_create("ph_box.mdl",nullvector,swing_gondela);
ent_create("ph_sphere.mdl",vector(50,50,20),molen);
ent_create("ph_sphere.mdl",vector(0,50,20),molen);
ent_create("ph_sphere.mdl",vector(-50,50,20),molen);
ent_create("ph_sphere.mdl",vector(-50,0,20),molen);
ent_create("ph_sphere.mdl",vector(-50,-50,20),molen);
ent_create("ph_sphere.mdl",vector(50,-50,20),molen);
ent_create("ph_sphere.mdl",vector(50,0,20),molen);
ent_create("ph_sphere.mdl",vector(0,-50,20),molen);
ph_setgravity (vector(0,0,-300));
while(molen_arm==NULL) {wait(1);}
phcon_setmotor (gcon,vector(1,2,0),nullvector,nullvector);
vec_set(camera.pan,vector(340,-18,0));vec_set(camera.x,vector(-173,47,72));
}
A7 Commercial Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
|
|
|
Re: tilt + rotation
[Re: XD1v0]
#261617
04/18/09 21:05
04/18/09 21:05
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
XD1v0 aswell as EvilSOB, you guys are the greatest!
It's all fixed now, just need to finetune the cars acceleration by gravity, and it's finished!
Thanks so much.. woohoo! ^^
EDIT: As said, everything works fine, yet the 24 cars won't do their job yet, but hard to explain that >_<
Last edited by Dreher; 04/18/09 22:44.
A7 7.77
|
|
|
Re: tilt + rotation
[Re: Dreher]
#261653
04/19/09 09:16
04/19/09 09:16
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Excellent. Glad its working out.
For the cars behaviour, I would play with their "phent_setmass" more than gravity. Seems to be easier to control.
Last edited by EvilSOB; 04/19/09 09:18.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: tilt + rotation
[Re: EvilSOB]
#261675
04/19/09 11:58
04/19/09 11:58
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Yep EvilSOB, I hang a box behind the car, so it rotates better, and play with mass abit, not too much of course! the FINAL thing that needs fixing, before I can go on with textures, lightning etc. Each satelite holds 4 cars, and these cars are tilted with 5 degrees, take a look: If you look closely, you can see they all standing with 5 degrees on the satelites, and then accelerate by gravity, how to achief this 5 degrees tilt which does also work with mass? The code XD1v0 provided did the job for the satelites and platform, but the cars need some different rotation, and it really MUST work together with MASS, if I can't use MASS, I won't be able to simulate the ride correctly! Thanks so much
A7 7.77
|
|
|
Re: tilt + rotation
[Re: Dreher]
#261688
04/19/09 13:20
04/19/09 13:20
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I would guess you need to 'tilt' the cars in MED, as the real cars look to be "shaped" with that tilt. And getting the rotation to be affected by the off-center mass, cant you just position the mass away from the center of the car model? Probably toward the 'high' point of the car, so it is a bit more reactive and "swingy". (remember I am next to useless with physics)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|