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
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, Akow, AndrewAMD), 1,505 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
Page 1 of 2 1 2
tilt + rotation [Fixed] #261495
04/17/09 21:39
04/17/09 21:39
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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=6803YrCNwNY

As 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: Dreher] #261525
04/18/09 09:51
04/18/09 09:51
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
I change my code to you request.Is this you want to do?
link



A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: tilt + rotation [Re: XD1v0] #261537
04/18/09 11:32
04/18/09 11:32
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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! wink

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 smirk

Last edited by Dreher; 04/18/09 12:41.

A7 7.77
Re: tilt + rotation [Re: Dreher] #261605
04/18/09 20:13
04/18/09 20:13
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Strange, that you using Lite-c or C-script, and that version? Realy I dont understand why map dont opened. Ok I am lost but try write code without map.


A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: tilt + rotation [Re: XD1v0] #261609
04/18/09 20:21
04/18/09 20:21
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
I don't write on C-script usualy and previous code was in Lite-c. cool
There is code, it run without map. So if this code dont work i must go mad laugh
Code:
#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 cool
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
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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 Offline
Expert
EvilSOB  Offline
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
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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 smile


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 Offline
Expert
EvilSOB  Offline
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
Page 1 of 2 1 2

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