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 / Sparkys nto setting up model correctly.

Author
Message
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 23rd Mar 2008 09:05 Edited at: 25th Mar 2008 04:34
hey,
i have been playing around with sparky's.dll and got it mostly working. I have brought in the Miko_walk.x model (simply for testing etc) and made her walk and everything. However i have setup the mikowalk model object for collision. But it dosn't seem to be setting her collision data correctly. from walking around the room it apears to be picking her up as a very small cube just on the floor. so she partly enters walls and walks through the bed in the room.
video demonstrating linked
http://www.sanitarium.fm/upmod/upt2.avi





*EDIT*
ok the problem dosn't apear to be quite what i thought.
i have attached an image from when i do an SC_DrawObjectBounds
and have setup the object as a complex object. (seems to act exactly the same way as setting up the object normally).




any help is apriciated.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Mar 2008 18:12
Well... There is a function you can call called dbObjectCollisionCenterX()...Y...Z... And it seems that Sparky's idea of the "true center" of the model MIGHT NOT MATCH.

Regardless.... One reason or another your Model is not being rendered how the "Verts" are stored.

For experiment, TRY setting up the object BEFORE you FixObject Pivot and see if that helps... it shouldn't matter but it might. also there is a sparky command to allow for Scaling - though I don't think this is your problem.

Lastly - as a final resort - You Could Always resort to Sphere or Box collision just to see if the (by showing collision bounds) if it makes a different or not.

A COMPLETELY LAST RESORT would be to have a CLONE (not an instance - so you can EXCLUDE IT from Rendering) that is positioned EXACLT how your model is, but lower so the collision bounds for it match your VISIBLE player model, but USE it for collision only - like I said - EXCLUDE it (dbSetObjectExcludeOn(ID) I think is the command).

Ideal? no - but if your 3d modeller is somehow confusing Sparky with how the model is laid out - it would work.

Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 24th Mar 2008 19:37
ok well changing to sphere /box collision yielded the same results.

when i setuptheobject BEFORE rotating . the model apeard rotated but the collision bounds did not! they apeared in the models position as if they had not been rotated.
allso can i note that when the model is first created it is spawns at the Height that the object bounds are at but then my gravity procedure pulls the model down untill it senses a collision with the floor.
so the collision bounds apear to be correct, IF i didn't have gravity, (can i allso not that although the object bounds apeared at 90 degrees as pictured. the collision detection apeard unaffected and is acting as it did before however the model is still not coliding properly as it is coliding with the light on the ceiling which is clearley far above the visible model. however when object bounds are shown the object bounds DO intersect the light so i am really confused )

have included picture of object bounds when setup before rotation (note that i AM using SC_UpdateObject in the gravity sub and all movements subs)

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Mar 2008 19:41 Edited at: 24th Mar 2008 19:42
AHHH....you're not updating the model each loop. Try SC_Update(objectid) each loop.

[edit] yes you are...DOH [/edit]

Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 24th Mar 2008 21:45
ok my solution for now is to try out the Ageia PhysX SDK and see if that can fix the issue (and supply all my physics at the same time!!)
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Mar 2008 22:09
That it does well - though guess what? If you want poly perfect collision - FORGET IT! Spheres, Boxes, or ...nothing!

For static? No Problem. For Dynamic? Sphere, Boxes... um... Yeah.. thats all!

That little point is a THORN in my side.

Sparky, I still think the idea I said about a cloned object that was "offset" so the bounds surrounded your on screen visual model might be a workable solution.

I do think its something about your model though only because sparky has worked so well for SO MANY people in so many different GENRE's etc etc.

Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 24th Mar 2008 23:04
its a model that comes WITH the GDK !

from the camera sample!
Miko_walk.x

well i will see if the ageia sdk will work as i need a physics engine anyway

(i tried loading other models from the dark matter pack provided with the GDK but they apear as invisible (and i know they are loading cos if the file dosn't exist the game crashes out quite nicly) )
i tried with the punk and the tech and the babe models ! :S
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Mar 2008 00:15 Edited at: 25th Mar 2008 00:16
I'll do ya a favor... if you package up the media and the code solution (SO I DONT HAVE to SET UP the environment) I'll work it through for ya!

Don't sweat the model - I can prove I have Dark Matter 1 and 3.

-- Its 2 I don't have... didn't really want it.. kinda sux... but I may be forced to get that too because all the decent GFX now by TGC are FPSC - ...WAAAAAAAA

LOL
Jason - So Bundle it up - not the *.pdb or the *.NCB (intellisense database - as its useless bloat)

[edit]that "Babe" model is ugly as hell![/edit]

Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 25th Mar 2008 01:44
please check your e-mail for the information to get my source code + media (the model comes free with gdk which is also free so i don't think TGC are going to be too worried about me sending it to you )
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Mar 2008 18:46
I'm on it... as you know... hopefully tonight I'll finish.

For the forum readers - Movian has some good stuff going on in his code. He basically was calling sparky more then he had to and its very close to working.

I'm trying a few things with the code is all...

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Mar 2008 20:29 Edited at: 29th Mar 2008 20:29
That was a problem with animated models, the raw vertex locations are in a very different place than the intended (bone modified) location, does this still happen with the latest (2.04) version?

Available here: http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

If all else fails you can create a dummy object that looks like the object to create it's collision data e.g.



The collision code doesn't mind what object is in the loaded position just that one exists.

At any rate the collision data will not follow the movements of an animated model as it makes a copy of the vertex positions at the moment of setup for performance reasons.
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 29th Mar 2008 22:41 Edited at: 29th Mar 2008 23:08
Thanks Paul I shall update to the new version.

After in-depth testing me and Jason discovered that the problem appeared to be unique to the Miko model(at least for what I was doing). After doing all I/we could with the model I did some testing with the Dark Matter models included with the GDK (after I figured out the reason I couldn't see them was because I need to scale them to 9000 on all dimensions!!)
when using the tech, babe and punk models the boundaries (and so far the collision) appears to be working correctly. I am unsure as to the cause of this yet however.

-EDIT-
have updated to the newest version you provided in the post.
loaded up the Miko_walk Model and set her up with ox collision and the drawn objectboundaries still apear to start about at her waist height! (this is withought animation) sam as the screen shot provided in the top post. hwoever it does not apear to actually be colliding with the box shown now which allways helps!

PS. thanks for a very nice tool, it is much apriciated.

Login to post a reply

Server time is: 2024-11-20 07:22:29
Your offset time is: 2024-11-20 07:22:29