Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
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
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 819 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
Rating: 5
Page 26 of 41 1 2 24 25 26 27 28 40 41
Re: Newton 2 wrapper [Re: VeT] #273075
06/21/09 10:20
06/21/09 10:20
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
Yes, the cones are rotating, but it's very hard to explain what their doing.. i'll upload a video soon.

Re: Newton 2 wrapper [Re: the_mehmaster] #273077
06/21/09 10:33
06/21/09 10:33
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
thats the best variant 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: Newton 2 wrapper [Re: VeT] #273083
06/21/09 11:15
06/21/09 11:15
Joined: Apr 2009
Posts: 14
Poland, Germany
E
EnjoMitch Offline
Newbie
EnjoMitch  Offline
Newbie
E

Joined: Apr 2009
Posts: 14
Poland, Germany
I got some help from Julio and Delfi on Newton forum.
Problems with rolling objects, bouncing from edges can be solved by greatly increasing NewtonUpdate call frequency. So if the problem of GS is that it doesn't allow you to call a function in a while loop more often than once per frame, you can use a for loop in that while loop, which slices the current (time_frame / 16) into time intervals (subDt) so little, that when calling NewtonUpdate as many times as the count of slices, you get the necessary NewtonUpdate call frequency. Of course, you also you have to pass NewtonUpdate the correct sub delta time.

Here's the code, adapted to your wrapper, for super precision required in simulations:
Code:
void newton_update()
{
  var newtonFPS = 1000;
  if ((newton_running) && (nworld!=0))
  {
			
  float dt = time_frame / 16;
  var vratio = (dt * newtonFPS);
  var n = integer(vratio) + 1;
  float subDt = dt / n;
  int i;
  for ( i = 0; i < n; i++ )
    NewtonUpdate(nworld, subDt);
    //  proc_mode = PROC_LATE;	
  }	
}



You could pass the desired Newton FPS with newton_start() for example.


Another problem is that while boosting Newton FPS to solve bouncing on edges problem solves it in case of models, it doesn't work for blocks. What do you suspect? Vertices set not precisely enough maybe?
I'll investigate this myself after I fully integrate Newton into my game. Finally I have at least one firm solution. Thanks so far.

Re: Newton 2 wrapper [Re: EnjoMitch] #273088
06/21/09 12:06
06/21/09 12:06
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Wow, looking like this works :))
i tried some examples of time slicing, but looking like this really works, thank you smile

I don't think, that its because of vertices... Maybe try to increase frequency.


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: Newton 2 wrapper [Re: VeT] #273094
06/21/09 12:54
06/21/09 12:54
Joined: Apr 2009
Posts: 14
Poland, Germany
E
EnjoMitch Offline
Newbie
EnjoMitch  Offline
Newbie
E

Joined: Apr 2009
Posts: 14
Poland, Germany
No problem. I wanted to give something back.

I tried increasing the frequency up to 10000, but even that didn't help.
Fortunately, the blocks work perfectly as walls with continuous collision mode on, and I can build floor with a set of 2^n x 2^n models easily.

Re: Newton 2 wrapper [Re: EnjoMitch] #273096
06/21/09 13:08
06/21/09 13:08
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Try to increase to 1000000.. you'll see the difference wink
I think, you may make newtonFPS lower.


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: Newton 2 wrapper [Re: VeT] #273104
06/21/09 13:14
06/21/09 13:14
Joined: Apr 2009
Posts: 14
Poland, Germany
E
EnjoMitch Offline
Newbie
EnjoMitch  Offline
Newbie
E

Joined: Apr 2009
Posts: 14
Poland, Germany
Than 1000? No, I don't think so. Notice that my test case works with about 400 - 500 FPS, which gives 400 - 500 FPS for Newton. Setting it to 1000 gives two or three times that much FPS (three times because of that +1. It's AT LEAST 1000). It's suspicious that you need at least 1000 FPS, but it does make the difference. You can try lowering it for the test case below GS FPS and you'll see the ball bouncing then.

[EDIT]
Lines
var vratio = (dt * newtonFPS);
var n = integer(vratio) + 1;

can be merged into one line
var n = integer(dt * newtonFPS) + 1;
of course.



Last edited by EnjoMitch; 06/21/09 13:27.
Re: Newton 2 wrapper [Re: EnjoMitch] #273109
06/21/09 13:26
06/21/09 13:26
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Real difference i see only with newtonFPS = 100000, then it works very laggy. Anyway, there is a little difference between 1000 and 1: car bounce in different ways... I'll check it in your level


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: Newton 2 wrapper [Re: VeT] #273110
06/21/09 13:28
06/21/09 13:28
Joined: Apr 2009
Posts: 14
Poland, Germany
E
EnjoMitch Offline
Newbie
EnjoMitch  Offline
Newbie
E

Joined: Apr 2009
Posts: 14
Poland, Germany
If you've already boosted the Newton's FPS, which is what would satisfy Newton guys, maybe it's about time to report a bug at their forum

Re: Newton 2 wrapper [Re: VeT] #273111
06/21/09 13:31
06/21/09 13:31
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Ah, i see... with your update function, ball doesn't move through the wall 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
Page 26 of 41 1 2 24 25 26 27 28 40 41

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