Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 923 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
pXent_settype #451374
05/05/15 02:18
05/05/15 02:18
Joined: Apr 2015
Posts: 9
Ontario, Canada
K
kornstar Offline OP
Newbie
kornstar  Offline OP
Newbie
K

Joined: Apr 2015
Posts: 9
Ontario, Canada
Hi,

I'm trying to create a small game that uses physics to move a ball around on a small flat table by tilting the table, I have successfully added physics to the ball (as far as I know) from the example in the workshops but I'm having a hard time setting up the table.

I first tried to simply set the table to tilt/roll using mouse_force.x and mouse_force.y and was able to get the table to move as I wanted it to but without adding the 'pXent_settype' I found that the ball would go right through the table.

I then tried to add physics to the table using PH_BOX, but the table is then subject to gravity (just like the ball) and falls out of sight.

My latest attempt was to set the table to
Code:
pXent_settype(me, PH_RIGID, PH_PLANE);



and the table stays where I put it but now the movement of the mouse no longer affects the tilt/roll of the table.

does anyone know if/how I can set-up the physics on the table so that the ball will not go through the table but still be able to make the table tilt/roll with the movement of the mouse and not have it fall with gravity?

any and all help with this is appreciated laugh

edit: I recently found the includes folder and opened ackphysX.h and am reading through it to try to figure this out, but still any help from experienced users is appreciated.

Last edited by kornstar; 05/05/15 03:15.
Re: pXent_settype [Re: kornstar] #451380
05/05/15 07:16
05/05/15 07:16
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
the physic objects angles are managed by the physics engine. You can not set the angles directly. You need to rotate them by applying forces. I think 'pXent_setangvelocity' is the best for your needs, but you can also control the table by applying torque (pXent_addtorque...) or uncentered linear forces (pXent_addforce...).

The table have to hang from the world by a joint (pXcon_add) in order to avoid falling to the infinite. PH_BALL joint is the simplest but it does not have rotating limits. You may set up a double PH_HINGE.

Salud!

Re: pXent_settype [Re: txesmi] #451384
05/05/15 08:16
05/05/15 08:16
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hi!

I think you are trying to create something similar to Labyrinth game on mobile devices (you won't be able to see the rolling of the table on the video, cause iphone is actually the table grin ). I've made one pretty long time ago, and I didn't roll the table at all! Think about it in a different way! Don't roll the table, but change camera angles instead! For the end user is doesn't really matter since it looks like table is rolling and ball is moving correctly.

Edit: I finally found this old thread (it's from 2011) grin

Edit2: as an example, try this demo (to understand what I've meant):
Code:
void main(){
	fps_max = 60;
	
	level_load("");
	wait(3);
	
	ENTITY* planeEnt = ent_create(CUBE_MDL, nullvector, NULL);
	vec_set(planeEnt.scale_x, vector(10, 10, 0.5));
	wait(1);
	c_setminmax(planeEnt);

	var i = 0;
	
	ENTITY* testEnt[4];
	
	for(i = 0; i < 4; i++){
		testEnt[i] = ent_create(CUBE_MDL, nullvector, NULL);
		vec_set(testEnt[i].scale_x, vector(10, 1, 1));
		wait(1);
		c_setminmax(testEnt[i]);
	}
	
	vec_set(testEnt[0].x, vector(0, planeEnt.max_y - testEnt[0].max_y, testEnt[0].max_z - (testEnt[0].min_z / 2)));
	vec_set(testEnt[1].x, vector(0, planeEnt.min_y + testEnt[1].max_y, testEnt[1].max_z - (testEnt[1].min_z / 2)));
	vec_set(testEnt[2].x, vector(planeEnt.max_x - testEnt[2].max_y, 0, testEnt[2].max_z - (testEnt[2].min_z / 2)));
	vec_set(testEnt[3].x, vector(planeEnt.min_x + testEnt[3].max_y, 0, testEnt[3].max_z - (testEnt[3].min_z / 2)));
	
	testEnt[2].pan += 90;
	testEnt[3].pan += 90;
	
	var cam_pan = 0, cam_tilt = -90;
	
	camera.arc = 90;
	
	while(1){

		cam_pan -= 0.05 * mickey.x;
		cam_pan = clamp(cam_pan, -5, 5);

		cam_tilt -= 0.05 * mickey.y;
		cam_tilt = clamp(cam_tilt, -95, -85);
		
		vec_set(camera.pan, vector(0, cam_tilt, 0));
		ang_rotate(camera.pan, vector(cam_pan, 0, 0));
		
		vec_set(camera.x, vector(-(cam_tilt + 90) * 2, -(cam_pan) * 2, 150));
		
		wait(1);
	}
}



Greets

Last edited by 3run; 05/05/15 09:42. Reason: added code

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451385
05/05/15 08:36
05/05/15 08:36
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
I think setting the table as PH_CHAR and rotating it with pXent_rotate should also work. Just try it!


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: pXent_settype [Re: alibaba] #451386
05/05/15 08:40
05/05/15 08:40
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: alibaba
I think setting the table as PH_CHAR and rotating it with pXent_rotate should also work. Just try it!
Unfortunately it won't, cause CHAR can have only BOX and CAPSULE shape (maybe convex works too, but it has it's limits too).

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451395
05/05/15 15:31
05/05/15 15:31
Joined: Apr 2015
Posts: 9
Ontario, Canada
K
kornstar Offline OP
Newbie
kornstar  Offline OP
Newbie
K

Joined: Apr 2015
Posts: 9
Ontario, Canada
Originally Posted By: 3run
I think you are trying to create something similar to Labyrinth game on mobile devices (you won't be able to see the rolling of the table on the video, cause iphone is actually the table grin ). I've made one pretty long time ago, and I didn't roll the table at all! Think about it in a different way! Don't roll the table, but change camera angles instead! For the end user is doesn't really matter since it looks like table is rolling and ball is moving correctly.


You are correct, the old school labyrinth "board" game is exactly what I was thinking about, It seemed to be a fairly simple idea to create, I'm now figuring out that there will be a lot more to it than I had originally anticipated (as is the case with almost any idea I have), but I'm going to stick with it for learning purposes.

Just to clarify, I think that what you meant by:

Originally Posted By: 3run
Think about it in a different way! Don't roll the table, but change camera angles instead!


is to keep the table flat, apply the forces to the ball instead and have the camera tilt to create the illusion that the table is tilting. Is that what you meant?

@ txesmi, 3run, and alibaba: thank you all for taking the time to help me, I very much appreciate it and I will look through and try your suggestions sometime today.

Thanks again laugh

Re: pXent_settype [Re: kornstar] #451398
05/05/15 15:59
05/05/15 15:59
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Quote:
is to keep the table flat, apply the forces to the ball instead and have the camera tilt to create the illusion that the table is tilting. Is that what you meant?


Yes that is exactly what was suggested laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: pXent_settype [Re: DLively] #451405
05/05/15 17:11
05/05/15 17:11
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: kornstar
Just to clarify, I think that what you meant by:

Originally Posted By: 3run
Think about it in a different way! Don't roll the table, but change camera angles instead!


is to keep the table flat, apply the forces to the ball instead and have the camera tilt to create the illusion that the table is tilting. Is that what you meant?
Yes, that's exactly what I've meant. Don't rotate the table, but rotate and move camera (in the opposite direction of the rotation)! Create 'illusion' of rotating table. I'm pretty sure none of those games actually really rotating the table, it's more likely to be a static object, for performance and stable simulation issues.

To make things even more clear, just run the code I'm posted above, it already has camera movement part, so you can start with it as a base. You can also use those two variables (which are used to rotate and move camera) to apply forces to the ball (in the opposite direction of the rotation I guess), so it will really looks like table is rotating, and ball is sliding down.


Originally Posted By: DLively
Quote:
is to keep the table flat, apply the forces to the ball instead and have the camera tilt to create the illusion that the table is tilting. Is that what you meant?

Yes that is exactly what was suggested laugh
Thank you scorekeeper tongue


Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451408
05/05/15 17:43
05/05/15 17:43
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Quote:
Thank you scorekeeper

What do you mean?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: pXent_settype [Re: DLively] #451409
05/05/15 17:56
05/05/15 17:56
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: DLively
Quote:
Thank you scorekeeper tongue

What do you mean?
That means that I don't need anyone to confirm my words and speak for me.
Keep that in mind in order to avoid misunderstandings in future laugh

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451411
05/05/15 18:06
05/05/15 18:06
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Thanks, But I can say what I want, when I want. Keep that in mind in order to avoid misunderstandings in the future.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: pXent_settype [Re: DLively] #451413
05/05/15 18:08
05/05/15 18:08

M
Malice
Unregistered
Malice
Unregistered
M



Lol love these combative posts. But to help the newbies can we port them over to a Rants? It floods the thread otherwise.

Just asking,
Mal

Re: pXent_settype [Re: ] #451416
05/05/15 18:16
05/05/15 18:16
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: DLively
Thanks, But I can say what I want, when I want. Keep that in mind in order to avoid misunderstandings in the future.
Man, say whatever you want, but don't speak for me, ok? grin As I've said, if I'll need scorekeeper, I'll let you know.

Originally Posted By: Malice
Lol love these combative posts. But to help the newbies can we port them over to a Rants? It floods the thread otherwise.

Just asking,
Mal
You are actually right. My bad.

kornstar@ sorry for offtopic man.

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451417
05/05/15 18:22
05/05/15 18:22
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I didn't speak for you. I spoke for myself. Infact, I AGREED with what you said, so stop being so uptight. Your not the Admin, or mod. Just a user. Stop trying be something your not - the boss. I'll do and say what I want when I want and agree with or disagree with whomever I'd like. In other words: (I don't need your permission to post on this forum)


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: pXent_settype [Re: DLively] #451418
05/05/15 18:23
05/05/15 18:23
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: DLively
I didn't speak for you. I spoke for myself. Infact, I AGREED with what you said, so stop being so uptight. Your not the Admin, or mod. Just a user. Stop trying be something your not - the boss. I'll do and say what I want when I want and agree with or disagree with whomever I'd like. In other words: (I don't need your permission to post on this forum)
stop offtopic and check your PM!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451419
05/05/15 18:27
05/05/15 18:27
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
You totaly, needlessly went off topic, and continue to do so. If you want to boss people around, or be a bully -- Im sure others would advise you to go to your own forum.

I simply told kornstar that the information you provided was correct (staying on topic) Your attempts to be be-little me brought it off topic.

Last edited by DLively; 05/05/15 18:28.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: pXent_settype [Re: DLively] #451420
05/05/15 18:31
05/05/15 18:31
Joined: Apr 2015
Posts: 9
Ontario, Canada
K
kornstar Offline OP
Newbie
kornstar  Offline OP
Newbie
K

Joined: Apr 2015
Posts: 9
Ontario, Canada
As far as I'm concerned the information I needed is all on the first page and if I have any other questions I will post them in a new thread specific to the question so feel free to duke it out all you like tongue

Re: pXent_settype [Re: kornstar] #451421
05/05/15 18:42
05/05/15 18:42

M
Malice
Unregistered
Malice
Unregistered
M



Quote:
and if I have any other questions I will post them in a new thread specific to the question


My point.

Re: pXent_settype [Re: kornstar] #451422
05/05/15 19:12
05/05/15 19:12
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: kornstar
As far as I'm concerned the information I needed is all on the first page and if I have any other questions I will post them in a new thread specific to the question so feel free to duke it out all you like tongue
Usually we all leave in peace and harmony, don't think that forum is fulfilled with evil persons like me grin

Edit:

I just noticed that kornstar is from Canada too. Maybe you guys even know each other (DLively and kornstar), that makes sense actually. I would probably act the same (trying to help) if I would see someone from Russia over the forum. So I probably overreacted on what DLively wrote, and I'm sorry for that.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_settype [Re: 3run] #451431
05/06/15 02:14
05/06/15 02:14
Joined: Apr 2015
Posts: 9
Ontario, Canada
K
kornstar Offline OP
Newbie
kornstar  Offline OP
Newbie
K

Joined: Apr 2015
Posts: 9
Ontario, Canada
Originally Posted By: 3run
I just noticed that kornstar is from Canada too. Maybe you guys even know each other (DLively and kornstar), that makes sense actually. I would probably act the same (trying to help) if I would see someone from Russia over the forum. So I probably overreacted on what DLively wrote, and I'm sorry for that.


At first I wasn't even sure if I wanted to answer that because I don't want any blow over because of it but yes DLively and I do know each other, in fact we are related, I am his older cousin. It was DLively who got me interested in 3dgs in the first place, and much of what I know already was learned from him.

He used to help me with advice over the phone but our schedules don't always match up so I decided to start looking for help on the forum, I also figured that on the forum I would have access to the wide well of knowledge offered by the many helpful forum users and in the end the more input I can get...the more I will learn... and ultimately the better off I would be.

OH and don't worry about the "battle" posts, I have used many forums in the past and one thing that I learned is that when this many people get together in one place, people tend to butt heads from time to time (I'm not calling you Buttheads...well maybe DLively...lol tongue ) so I have not formed any bad impressions about this forum because of a couple little squabbles. I know from DLively that this is a great community and I look forward to getting to know you all regardless of what disagreements you have among each other.

So to end this all off I will say Thank you one more time to you all for the help with my question, and I'm sure I will have more questions for you all in the near future. grin

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