Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 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 | 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