Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, Ayumi), 773 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: ent_setvertex() [Re: EvilSOB] #390857
01/05/12 12:30
01/05/12 12:30
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
For examples, look in the knights on wheels and the infinite terrain samples. Both manipulate the terrain vertices heavily.

Re: ent_setvertex() [Re: jcl] #390858
01/05/12 12:41
01/05/12 12:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Will do... thanks dude.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ent_setvertex() [Re: jcl] #390863
01/05/12 13:10
01/05/12 13:10
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
thanx, I will check it and make some further trials...
sometimes I cannot find the proper sources of information, even if they are in the manual. maybe it's my fault...


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: ent_setvertex() [Re: sivan] #390869
01/05/12 14:05
01/05/12 14:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
Das Updaten der Kollisionshülle eines großen Terrains kann lange dauern. Um dem vorübergehend aus dem Weg zu gehen, setzen Sie das Flag PASSABLE des Terrains und setzen es im selben Framezyklus wieder zurück sobald die Terrainverformung fertig ist.

Does the terrain's collision hull get updated by the end of the frame, too, when ent_setvertex has been called on passable terrain? (Probably not.)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ent_setvertex() [Re: Superku] #390873
01/05/12 15:12
01/05/12 15:12
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Indeed not - that's the reason of the advice with setting the PASSABLE flag. The engine does not call c_updatehull when the terrain was passable during deformation.

Re: ent_setvertex() [Re: jcl] #390929
01/06/12 00:09
01/06/12 00:09
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
terrain_chunk = 0; is what I'm using and it DOES make a difference.

if I set it to 0 I get unchunked terrain which supports ent_fixnormals.

In A8.


But if ent_fixnormals() will also work on chunked terrain in future, I have no problem switching to chunked terrain laugh


And yes, I did read the manual about ent_get/setvertex().
Left with the problem that the colission did not work and finding out that c_updatehull() fixes it. Had to do some forum search to get this answer.


Last edited by Firoball; 01/06/12 00:15.
Re: ent_setvertex() [Re: FBL] #390943
01/06/12 08:09
01/06/12 08:09
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I checked level.c since it seems to be the best source.
line 292 (last line of terrain_fence):
c_updatehull(terrain,0); // adjust normal collision hull

my above mentioned problem (no hull update on chunk borders) is an A7 only phenomenon (since at my workplace I can use only A7 free), maybe caused by using ent_status(terrain,0) and not ent_status(terrain,1) for determining vertex quantity (results are 161*161 and 165*165 respectively if chunk size is 32 i.e. 5*5 chunks). but I don't know how to manage the duplicated vertices of chunk border edges... in A8 hull is updated properly by c_updatehull.

for fixing normals you can use simply c_trace, which sets hit.nx/y/z (or normal.x/y/z) and you can store it to c.v.nx/z/y. but it is not too fast at all, especially if you do not trace only the vertices, but all the neighouring faces and calculate an average of them. moreover, as I know if you want to get the same shading as produced by fixnormals or MED, there are 160 default normal vectors used for approximating real normals.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: ent_setvertex() [Re: sivan] #390952
01/06/12 10:17
01/06/12 10:17
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Setting terrain_chunk to 0 is not supported by A8. Yes, it disables chunking as in A7, but some A8 subsystems, such as collision, only support chunked terrain. Therefore we'll have to do something about terrain_chunk = 0 in a future version. It was a leftover from the past and should be disabled.

A case where c_updatehull is required is when the terrain is deformed and something does a terrain collision within the same frame. Then you must call c_updatehull directly after the deformation for preventing collision problems before the engine updates the hull. The engine updates it only at the end of the frame cycle.

I believe the duplicated terrain vertices are automatically updated when normals are directly set. But I'll check this to be sure.

Re: ent_setvertex() [Re: jcl] #391035
01/07/12 03:33
01/07/12 03:33
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Originally Posted By: jcl

A case where c_updatehull is required is when the terrain is deformed and something does a terrain collision within the same frame.


That might have been my problem.
Thought I'veput enough wait(1) all over the code, but maybe I still had a gap somewhere.

But why should colission not work with unchunked terrain in A8?
That's what I'm doing... at least I'm using c_move and c_trace without problems...

Re: ent_setvertex() [Re: jcl] #398794
04/06/12 18:46
04/06/12 18:46
Joined: Nov 2004
Posts: 85
Deutschland, NRW, Eschweiler
A
annonymie Offline
Junior Member
annonymie  Offline
Junior Member
A

Joined: Nov 2004
Posts: 85
Deutschland, NRW, Eschweiler
Originally Posted By: jcl

ent_fixnormals is not required either, because it doesn't do anything with terrains. It's for models only. Thus, the normals of terrain must be set manually through the nx/y/z values. It would make sense to implement fixnormals for terrain also - in fact I see that it's already on our list.


To make my shader works right, I have also to set the terrain normals manually. To do that, I tried the follow:

Code:
c = ent_getvertex(terr, NULL, vertex);
vec_set(c.nx, vertex_normal);
ent_setvertex(terr, c, vertex);



Unfortunately the normals will not be changed... I don't know whats wrong, they all are still 0,0,1 although the normals I calculated have other directions. confused

Please help laugh


A8.30.5 Commercial
Page 2 of 3 1 2 3

Moderated by  aztec, Inestical, Matt_Coles, Tobias 

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