Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (AndrewAMD, fairtrader, 3run), 599 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: ent_fixnormals / moved bones [Re: jcl] #387118
11/14/11 14:48
11/14/11 14:48
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: jcl
This is possible, but you must do it manually.


Thanks for your fast comments smile Can you give me some hints how to achieve that? I did'nt tried that before. I would like to try that.

Re: ent_fixnormals / moved bones [Re: HeelX] #387119
11/14/11 14:59
11/14/11 14:59
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Call ent_getvertex, and then modify all the normals of the D3DVERTEX* list that you got. This should directly affect the normals. I haven't tried it yet, so I can't guarantee that it works, but it should. Be aware that when you don't use GPU bones, the D3DVERTEX->nx, ny, nz contains not the original normal but already the animated normal, which is transformed by the bone movement.

Re: ent_fixnormals / moved bones [Re: jcl] #387120
11/14/11 15:00
11/14/11 15:00
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thank you very much!

Re: ent_fixnormals / moved bones [Re: HeelX] #387278
11/16/11 14:00
11/16/11 14:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK...

So if we do our own vertex deformations, and need to re-calculate all the normals,
HOW do we re-calculate them?

Can you give me any hints or google-search terminology I can use to figure out how?

(I could have sworn I saw a formula in this thread before, but it seems to have vanished)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ent_fixnormals / moved bones [Re: EvilSOB] #387386
11/17/11 20:38
11/17/11 20:38
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
why do we have to recalculate the whole thing anyway? o.O

I thought for rendering, the transformed face is used, but in this case an old position is used. Can someone enlight me o.o


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: ent_fixnormals / moved bones [Re: jcl] #387572
11/20/11 21:56
11/20/11 21:56
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: jcl
Call ent_getvertex, and then modify all the normals of the D3DVERTEX* list that you got. This should directly affect the normals.


Hi, I tried this snippet, which should generate for all vertices a "rotating" normal, but it is all grey, all the time, from all sides:

Code:
int i;
for (i = 0; i < ent_status(e, 0); i++)
{
    CONTACT c;
    ent_getvertex(e, &c, i);
    
    VECTOR n;
    vec_set(&n, vector(1,0,0));
    vec_rotate(&n, vector(time_step * 4, 0, 0));
    
    vec_set((c.v)->nx, &n);
}



Other than this, can't you add a parameter or so to ent_fixnormals that enforces normal calculation on the current mesh (however it was transformed by the user)?

Last edited by HeelX; 11/20/11 21:57.
Page 2 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