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.

Dark GDK / So - Scaling - only effects Visuals? Dark Physics Ignores Scale/pivot fix, um....

Author
Message
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Feb 2008 04:04 Edited at: 21st Feb 2008 04:13
Ok - I'm very frustrated.

DarkGDK - Load an Object - scale it - pivot fix it after a rotate - then routines like dbObjectSizeX() return Wrong Values. (Unscaled values) So Scaling only effects apearance - not the STATISTICAL functions.

DarkPhysics - ALSO doesn't honor Scaling or Pivotfix - So if I do all the above - then Say "DarkPhysics - take my model and work it baby" it says SURE DUDE - but I will only work with the original model - not your scaled pivoted version! That's visual Only!

Ok - Everyone knows of the bugs that creep in if you create/delete objects all the time. So - the suggestions to load objects, create meshs of your scaled/rotated object then create an object from a mesh - is well - troublesome - as you lose things like texturing. So - what do you do then... keep two objects in memory? One for the visual - one to read stats about? It gets worse!

Ok - so I want to have physics work on my object - a box or sphere won't do - SO - to do this - I need to Load my object, Scale it, Rotate, Fix Pivot, make a mesh from this altered object, create an object from the mesh, keep both in memory, Tell Dark Physics to make a rigid body from my "Copy" then during the game I need to constantly move my VISUAL (original) to match where the physics one (the one I made from a mesh so scaling works-that is visually hidden!) is every frame.

This means I would need TWICE as many objects "in play" to get the results I want.

Guys... Am I missing something? Please say yes! From what I've read so far - I'm not missing anything... I'm just catching up to the know.

Any advice? Please Help.

[edit] This means - all the model packs I bought from TGC won't work correctly - meaning I can't use them - size so they look good together and expect them to work correctly for the frustrum code I wrote/ported to GDK from LIT's stuff - and it means I MAY have the option of finding (and buying) yet another program to scale the models - hopefully not losing the animations and texturing.... Does such a model program exist that will do it correctly? UGH[/edit]

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 21st Feb 2008 04:20
Yes, just as you posted this I have found a problem too, there is no ACTUALSIZE parameter in the object size fields to check for scaling too in the DarkGDK versions, it exists in DBP but not GDK, which I say they should add in


Making dreams possible, one line at a time...
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Feb 2008 05:20
Screenie of Scaled Darkmatter 3 huey's - however the Bounding boxes for the frustrum stuff - created from dbObjectSizeX and Object collision Center statisitics - are made alpha transparent so you can see how this would messs things up in straight DarkGDK - let alone DarkPhysics.

So - What modeling program do I need to buy to edit my darkmatter models without losing the animations and stuff I paid for?

Attachments

Login to view attachments
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 21st Feb 2008 05:38
@Jason

This is an issue with Dark Physics rather than GDK. I had to manipulate objects in the program I created them to get acceptable results.
Here is a post that I started when I found a similar isse
http://forum.thegamecreators.com/?m=forum_view&t=99795&b=30

I would suggest that you try loading the object into DBP or Dark GDK then saving them after you have set the scale and orientation you desire. Then use these objects in your project

Hope this helps

Codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 21st Feb 2008 06:46
I warned you of this bug.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Feb 2008 13:22
@David - Yes You Did!

@Codger - Tried that first. Maybe Loading, Scaling, Saving in DBPro will work - in DarkGDK it didn't help. Saves with Wrong Stat values (as if unscaled) yet visual size is scaled - just like no LOAD+SCALE+SAVE2DBO .

2 Solutions I see - One - Buy a modller and change the sizes, then resave - (BTW - so modeller I have now will load and save DarkMatter Models without messing them up...any sugestions?)

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 21st Feb 2008 14:43 Edited at: 21st Feb 2008 14:43
Every modeller I've tried removes the animation data when importing X files , kinda sucks huh!

Maybe, what you culd do is import the model into your modeller, rescale it. Then, using the dbAppendObject load up the animation data from the original and try saving it.

This is of course just guess work, but it might work.

Projects Started: 20
Projects Completed: 0
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 21st Feb 2008 15:56
Ok, just found a hacky work-around for this problem.

I have attached a DBP project which shows how you can get around this annoying problem.

The project is called Append Object but, it has nothing to do with the Append Object function

Projects Started: 20
Projects Completed: 0

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 00:31
MONOTONIC - DUDE YOU ROCK!!!!!!!!!!!!!!!!

THAT IS AWESOME AWESOME AWESOME!!!!!

"Change Mesh" WOW! Cool! Dancing a jig - wife staring funny at me - kids against wall cowering like I'm mad - cats ran out of the room - AWESOME!

(Now to see if DarkGDK has that command functional like DBPRo!)

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 01:14
Ok - I don't know how to use the physx debugger - but if you trust it - then that means this works for physics. The Object size function --- Tested in DBPro - returns same value before and after. I can make the frustrum work easier than physics mesh stuff.. cuz I can apply LAST SCALE To My Scalling and then to "returned Sizes" etc.

this is a LAME workaround though - well - it looked like a easy one - but now its more systematically hosed.... Change Mesh doesn't change Object Size Statistical reporting? THATS ANOTHER BUG Geesh...

kids back in room... cats a sleep... wife ignoring me ....

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 22nd Feb 2008 01:29
Yep, it doesn't fix the problem it's just a hacky work-around.

But at least it does allow the object to be added into the physics system with similar dimesnions to the rendered object.


This is a bug and there is no way for us to fix the source of the problem, unless of course TGC let us have the code The DBP versions of the dbObjectSize... functions have a parameter called ActualSize and if this is set to one the scaling is taken into account. There is a function called dbSaveMesh this obviously saves the mesh into an X format file, but it removes the animation but it does load up with the new scale values and saving the newly created object just loads up with the original scale values. SO maybe playing around a little you might get something, but until TGC fix it it's just gonna be a case of creating nasty work-arounds. Putting a plaster/band-aid over the wound as it were.


Anyhoo, to use the bebugger just fire it up before you execute the program (ensure you have called dbPhyEnableDebug before dbPhyStart), then when you program is running just switch to the debugger and the physical representation of your geometry will be there (with co-ordinates flipped, I think it uses left handed cartesian co-ordinates).

Projects Started: 20
Projects Completed: 0
Daggeth
17
Years of Service
User Offline
Joined: 3rd May 2007
Location:
Posted: 22nd Feb 2008 01:42
Im pretty sure the documented point "dbFixPivot" or something like that fixes this issue, please test because I'm no where near a computer with DB.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 22nd Feb 2008 01:57
dbFixObjectPivot forces the object to use it's current angles as it's default orientation.

Jason,

Just been looking through the header files for GDK and found these (undocumented) functions.

float dbObjectSizeX ( int iID, int iUseScaling );
float dbObjectSizeY ( int iID, int iUseScaling );
float dbObjectSizeZ ( int iID, int iUseScaling );


So just pass in a 1 for the iUseScaling and it should return the correct scaled size

Projects Started: 20
Projects Completed: 0
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 03:31
dbFixPivot does not fix Object Size thing - change Mesh we THINK fixes physics no test yet in DarkGDK - (sorry working on the scaling and I trust monotonic - he says debugger looks right for DBP I trust that and think it should be ok in DarkGDK - however there is no ACTUAL Size param in DarkGDK GRRRR - but in DBPro that flag works as advertised.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 03:32
hmmm didnt see your post...
Investigating those

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Feb 2008 03:50 Edited at: 22nd Feb 2008 06:35
That did it!!!!


Sorry for triple post guys - I do it so you "watchers" get email updates.

Ok that works - next on list is a test of Physics in DarkGDK with the change meshy (Monotonic - you still rock!)

Any ways (side note)- here is my current list of missing GDK definitions (and a missing function thanx to Lost in Thought:



Missing Function:


[edit]uploaded pic of scaled down heli - and using the darkgdk undoc'd actual size stuff monotonic found. Thanx man. Still need to check physics in DarkGDK - but progress definate progress.

[edit2]Physics does NOT respect Fix Object Pivot in DarkGDK - At least not after the whole change mesh thing.

Also - you see the pic right - Object Position + Collision Center = Perfect Alignment - my homemade bounding box is EXACTLY around the object.

When I add Physics - it Looks great (Less the whole Fix Pivot thing - (I dropped Fix Pivot deal - just rotate object - so its at leas tcorrect lookign ) any way - Its all aligned Perfect. Where the Object GOES - I can make my Bounding Box Go. EXCEPT when I smack it with a force - then the object position + Collision Center thing doesn't place it in the box... Its as if the Heli gets bumped OUT the bounding box - even though the bounding box is simpley going where the coord are fgor the help.... Like the heli will be half out the box after I ram it with a force - or two heli's slam into each other.

Its not the end of the world - my bounding boxes are a visual (for debugging) the frustrum culling. But its not SPOT ON - that bugs me. I could get glitches where heli disappears before its off screen. I can live but it looks bad depending on whats going on - picture a running soldger - disapeearing cuz frustrum culling code thought he left screen already but he didn't he was just CLOSE.

Ugh... definate progress - far from 100%

Attachments

Login to view attachments
manu
16
Years of Service
User Offline
Joined: 7th Jun 2008
Location:
Posted: 15th Jun 2008 12:12 Edited at: 15th Jun 2008 12:30
monotonic:

where did you find these?
Quote: "
float dbObjectSizeX ( int iID, int iUseScaling );
float dbObjectSizeY ( int iID, int iUseScaling );
float dbObjectSizeZ ( int iID, int iUseScaling );
"

I get an error:
error C2660: 'dbObjectSizeX' : function does not take 2 arguments

I have the exact same problem. The actual size doesnt change with
dbScaleObject ( 3, 5, 8000, 5 );


I got it. I added

to DarkSDKBasic3D.h
Dont know whether this is the correct way but it works.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 16th Jun 2008 06:38
I have a new nickname for you, jason.

"Angry Programmer"

If you can do any models for FW, reply to the FleetWars thread.

Click here!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Jun 2008 06:41
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th Jun 2008 07:35 Edited at: 16th Jun 2008 08:08
To repeat what I said in the other thread, there seems to be an error in that include file. Putting the missing declarations there will mask it but...

Quote: "The first set of prototypes appear at line 115, the second set is at line 344. I am uncertain why dbObjectSize is repeated at all, DBPro has no overloads for that function, but...

...If you are brave, the overloaded functions are in the library, I checked. You could replace lines 345, 346 and 347 with these three lines, and use the flag, like tobi543 suggested:

float dbObjectSizeX ( int iID, int ActualSize);
float dbObjectSizeY ( int iID, int ActualSize );
float dbObjectSizeZ ( int iID, int ActualSize );
"


Perhaps monotonic's DarkSDKBasic3D.h is different?

As for the other function prototypes that you have put there:
dbCameraExist
I inserted the following line in DarkSDKCamera.h at line 28 :


That one seems to be genuinely missing from my set.

dbGet3DMathsExist
My copy of DarkSDK3DMaths.h has the prototype of dbGet3DMathsExist, and it also matches the prototype in 3DMaths.lib

dbDLLCallExist / dbLoadDLL
There are two prototypes for dbDLLCallExist, one takes a DWORD, and is for checking functions by their ordinal value, I suppose. The other checks them by function name. They are in the include file DarkSDKSystem.h Also, dbLoadDLL is there, too but it is prototyped to accept a DWORD as the first parameter. (unsigned long is no problem, I am just wondering if all of our include files are different.)

dbSetBlendMappingOn
My copy of DarkSDKBasic3D.h matches the Basic3D.lib file and my DarkBASIC Professional in that there are two functions, one that takes 3 parameters and one that takes 5. Is there an overload that takes 4 parameters?

GetMatrix4Element / dbGetMatrix4Element
A search of my entire GDK installation failed to find either one of those at all. Does it work for you?

Login to post a reply

Server time is: 2024-09-29 23:20:32
Your offset time is: 2024-09-29 23:20:32