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 / Spliting up a model into several

Author
Message
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 8th Dec 2012 19:43
Hi!

I've written a routine for a player to walk up and down in a stair.
The model for this is not an external model, it's several objects placed next to each other making to illusion of a solid staircase.

Each object represents one step and is made up using the command
'make object box'
Using this method makes me able to calculate the height of each step which is crucial for my routine to work.

But what if I'd load a 3D model that is a staircase in it's entirety?
Mayby I can access the vertexdata somehow to split this thing up into several objects allowing me to read the height of each step?
What I'd need to do is reading the structure/polygons of the object to make the player object follow it ( just like the functionality of the commands for following the contour of a terrain)

Anyone that knows the best way of doing this? Thoughts? Ideas?

Best!

www.memblockgames.com
mistsnake
16
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Inside the matrix
Posted: 8th Dec 2012 21:45
if your climb animation is constant you could very easy base the height of stairs on that, it minimises work being done then for your char by the cpu/gpu, this is a normal way in games from my observations, after all in real life step height are pretty standard for stairs
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 8th Dec 2012 23:00
I would use Intersect Object(). Cast a ray from above the player downwards to the staircase and the distance will be returned which you can calculate the height from. If you like you could precalculate this and store it for later.

It's possible to do this with vertexData commands but intersect object would be the quickest/easier way imo.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Dec 2012 00:50
Hi there.
As Fallout says, intersect object is ok...or even better using sparkys collision that is free.

Cheers.

I'm not a grumpy grandpa
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 9th Dec 2012 05:31
I find sparkys collision rather complicated to use, probably because I've never found the time to learn it, so I'll stick to the native commands for now. But if I can't get it to work with intersect object somehow,,, mayby I'll turn my head to sparkys

www.memblockgames.com

Login to post a reply

Server time is: 2026-07-08 01:53:45
Your offset time is: 2026-07-08 01:53:45