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
1 registered members (Dico), 16,767 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
Page 1 of 5 1 2 3 4 5
placing models on the terrain #170538
12/01/07 22:31
12/01/07 22:31
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I'm wondering if there isn't a better way to position a newly created model on terrain. I am currently using this method, which doesn't always seem to work correctly even when the models origins are in the right place.

temp.z -= 10000;
my.z -=c_trace(my.pos,temp,use_polygon|ignore_me|ignore_passable|ignore_passents);

Re: placing models on the terrain [Re: JazzDude] #170539
12/01/07 23:12
12/01/07 23:12
Joined: Aug 2004
Posts: 2,215
I
ISG Offline

Expert
ISG  Offline

Expert
I

Joined: Aug 2004
Posts: 2,215
Maybe temporary physics until it hits the terrain? Just a weak idea.


Ground Tactics - Coming Soon
Ground Tactics OFFICIAL WEBSITE
Re: placing models on the terrain [Re: ISG] #170540
12/01/07 23:37
12/01/07 23:37
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
I had the weirdest problem using the c_trace function for an elevation radar in that only every other trace gave a valid result (hit) and every other gave no result (null). It was very predictable. I never solved or figured out the underlaying cause but instead used a workaround by always doing two traces in a row and only using the one with a result. I did that by doing something like this:

c_trace();
if(result)
{
// do ent_create or whatever
}
else
{
c_trace(); // again
// then do whatever ...
}


I think it might be a bug in c_trace but I never filed a bug rep so I can't say for sure.

Hope this helps to solve your troubles too,
cheers,
tindust

Re: placing models on the terrain [Re: tindust] #170541
12/01/07 23:52
12/01/07 23:52
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
It seems like there should be some way to identify the z value of the terrain surface at any particular coordinate.

like

z = ent_terrain.surface;

Wouldn't that be nice?

Re: placing models on the terrain [Re: JazzDude] #170542
12/02/07 00:07
12/02/07 00:07
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
You can use target for that. The target vector is set to the world position of the point where your trace hits the surface. Its z is it.

Re: placing models on the terrain [Re: tindust] #170543
12/02/07 00:28
12/02/07 00:28
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Oh, if you meant the z of a specific terrain vertex that could be done with the vec_for_vertex but one would have to know the vertex number then. (I suppose that number could also be found with a c_trace ...).

Re: placing models on the terrain [Re: tindust] #170544
12/02/07 00:39
12/02/07 00:39
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
This would be useless for the kind of terrain Jazzdude is talking about...it's poly-optimized and has huge spaces between the vertices

Re: placing models on the terrain [Re: Loopix] #170545
12/02/07 00:43
12/02/07 00:43
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Sure, so what's the solution then ... ?

Re: placing models on the terrain [Re: tindust] #170546
12/02/07 00:48
12/02/07 00:48
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Maybe "use_box" instead of "use_polygon" helps...?

Re: placing models on the terrain [Re: Loopix] #170547
12/02/07 01:00
12/02/07 01:00
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Well, I think we are talking about two different things here. 1/ If you want to find the coordinates of a vertex, well, they are far apart no matter what method one applies to find them. 2/ Finding a point of a trace hit I suppose will be the point interpolated inbetween vertices of the polygonized terrain if that is chosen for the trace. I have a hard time to see how a trace hit on the bounding box of the terrain would be more accurate. Maybe i misunderstand. Could you elaborate a bit ...

Page 1 of 5 1 2 3 4 5

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