Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Serialize in Newton - Problem

Author
Message
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 24th Feb 2011 22:56
So i am trying to serialize an object in Newton and save it to a file to call later (since my object is so big I needed to do this). However, when i serialize it, it doesn't work (by that I mean it still takes just as long to load and doesn't have the correct collision shaped around it). Here is my code to create a file for Serializing:


I use the output in my main program, but the errors I described above happen. I tried using the flags for the col = NDB_NewtonCreateTreeCollision(1) command, but it just spits out an error. Any ideas?

Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 25th Feb 2011 03:53
Surely there has been someone else whos used the Serialization in Newton and can help...

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 25th Feb 2011 06:25
You may need to setup the Newton World in order for it to work.

I've used the code below for my specific purposes (creating collisions on a .X mesh) and it makes an Unoptimized collision. I haven't tried optimized collisions in a long long time due to the dodgy behavior in the 1.2+ version of Newton... so I don't know if that may be your problem.



Also if your model is really big you may want to use the "limb by limb" flag,


A 3D marble platformer using Newton physics.
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 26th Feb 2011 01:50 Edited at: 26th Feb 2011 01:52
Okay, that works for some of the smaller objects, but it won't work for the bigger ones. I use the limb by limb, but when it is doing the collision, it just tells that there is an error and the window needs to close.

EDIT: and I used unoptimized and it did work better, thanks. Still have the problem above though

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Feb 2011 02:43
It might be exceeding the allowable size of tree collisions in Newton wrapper. I don't know what that size is, but I have had to use chunking in some of my game's level geometry in order to work around it. How many polys are in these models? And is it broken up into several limbs?


A 3D marble platformer using Newton physics.
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 26th Feb 2011 02:53
I dont know how many polys (not to great at using 3D Max), but its just one level with 2 sections connected by a ramp. Does that help?

Also, what is chunking exactly?

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Feb 2011 06:13
Display the object on the screen (no Newton collision yet) and call function statistic(1) to see how many polys are on the screen. But there must be a way to get a full count in your 3D modeler. It doesn't sound very big from your description, but there's not much else to go on.


A 3D marble platformer using Newton physics.

Login to post a reply

Server time is: 2024-04-26 09:37:06
Your offset time is: 2024-04-26 09:37:06