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
2 registered members (OptimusPrime, AndrewAMD), 14,580 guests, and 5 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
Computing Player and A.I Normals for Cyberplanets(For Delinkx) #262851
04/26/09 16:52
04/26/09 16:52
Joined: Aug 2003
Posts: 63
V
Vampyr1 Offline OP
Junior Member
Vampyr1  Offline OP
Junior Member
V

Joined: Aug 2003
Posts: 63
Hello I am trying to make a game where player and a.i charectors fight on actual cyberplanets rather than dynamic terrain. George Pirvu told me that I would have to
Quote:
ust compute the normal of each object and move them in the direction of their normal - that will make them move towards the center of the sphere, keeping them on the surface.


The thing is I don't know where I would 1) put the vec_for_normal (VECTOR* vector, ENTITY* entity, var number); instruction and 2)compute the normal of each object to make them walk on the sphere.

Can you help me with this please? thank you



Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: Vampyr1] #262852
04/26/09 16:53
04/26/09 16:53
Joined: Aug 2003
Posts: 63
V
Vampyr1 Offline OP
Junior Member
Vampyr1  Offline OP
Junior Member
V

Joined: Aug 2003
Posts: 63
OH yes I am not really that familiar with C script

Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: Vampyr1] #262856
04/26/09 17:31
04/26/09 17:31
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline
Expert
NITRO777  Offline
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Quote:
2)compute the normal of each object to make them walk on the sphere.
You wont compute the normals of the moving objects, you will compute the normals of the planet-sphere. the planet-sphere will have a normal for each polygon that makes it up. The sphere is made of many polygons, right? On each polygon that makes the sphere will have a normal to compute. the normal of each polygon of the sphere will be perpendicular to that polygon which makes it the perfect vector (the normal vector) by which you need to align your moving objects.

Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: NITRO777] #262933
04/27/09 04:00
04/27/09 04:00
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
hey are u using c-script or lite-c ? there is a difference in syntax. if tat is the case. kindly move this to c-script forum.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: delinkx] #262962
04/27/09 09:08
04/27/09 09:08
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
I also idint understaind, if you use lite-c or c-script
Anyway, it isnt contribution smile


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: VeT] #262985
04/27/09 11:20
04/27/09 11:20
Joined: Aug 2003
Posts: 63
V
Vampyr1 Offline OP
Junior Member
Vampyr1  Offline OP
Junior Member
V

Joined: Aug 2003
Posts: 63
well if I am using A6.40 I think it would be C script

Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: Vampyr1] #262986
04/27/09 11:21
04/27/09 11:21
Joined: Aug 2003
Posts: 63
V
Vampyr1 Offline OP
Junior Member
Vampyr1  Offline OP
Junior Member
V

Joined: Aug 2003
Posts: 63
o Nitro How would I do that then compute the normals of the planet sphere?

Re: Computing Player and A.I Normals for Cyberplanets(For Delinkx) [Re: Vampyr1] #262989
04/27/09 11:36
04/27/09 11:36
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
yes as nitro said, u need to compute the normal at the point where your entity is resting his foot. using the direction of this normal, u need to orient ur entity towards it.

ur ground normal is given by the vector "normal"

this is a lite-c snippet maybe can convert to c-script (sorry am not too familiar with c-script).

Code:
function place_me_on_ground
{	
  vec_set(temp, my.x);
 	temp.z -= 1000; // 1000 Quants down
 	c_trace(my.x, temp, IGNORE_ME); 
 	vec_set(my.x, target); // put on surface
 	vec_to_angle(my.pan, normal); // look upwards
}


since we dont have a vec_to_normal, the above uses the c_trace to get the angle.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Computing Player and A.I Normals for Cyberplanets(For Delink [Re: delinkx] #263281
04/28/09 21:38
04/28/09 21:38
Joined: Aug 2003
Posts: 63
V
Vampyr1 Offline OP
Junior Member
Vampyr1  Offline OP
Junior Member
V

Joined: Aug 2003
Posts: 63
Oh I see delinx thank you


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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