-
worldmodeler
- Posts: 3
- Joined: Mon May 16, 2011 10:01 am
Post
by worldmodeler » Mon May 16, 2011 10:13 am
Hello, dev community! =)
I'm working on the example "lesson10b" of "examples/3D/nehe", I've modified world.txt, and created some quads, but now I want to add collision events to these quads. How can I do that? (I'm a beginner^^)
Thanks in advance for your help

-
lazyprogramer
- Posts: 85
- Joined: Mon Sep 27, 2010 5:26 pm
Post
by lazyprogramer » Tue May 17, 2011 1:57 pm
Do you mean when the player (in this case it's just the camera) collides with the quads...?
-
elhobbs
- Posts: 358
- Joined: Thu Jul 02, 2009 1:19 pm
Post
by elhobbs » Tue May 17, 2011 5:38 pm
this is not really a libnds questions. there are numerous articles to be found on the web that describe different approaches to collision detection. take a look around on the web and then come back if you have specific problems implementing something on the ds.
-
lazyprogramer
- Posts: 85
- Joined: Mon Sep 27, 2010 5:26 pm
Post
by lazyprogramer » Tue May 17, 2011 8:15 pm
Well I think you could compare the coordinates of the polygons of the quads with the player's coordinates!
For the events you can add some bools which disable walking arround. You also can code a hitbox for the player!
Do you need the source or do you want to try it yourself?
-
worldmodeler
- Posts: 3
- Joined: Mon May 16, 2011 10:01 am
Post
by worldmodeler » Tue May 17, 2011 10:18 pm
The source will be helpful, thanks =D I've tried a lot of things but nothing works correctly

-
WinterMute
- Site Admin
- Posts: 2060
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
-
Contact:
Post
by WinterMute » Wed May 18, 2011 1:14 am
Show us what you've tried.
You'll learn much more from trying things and having others point out where you went wrong than from just using someone else's code.
-
relminator
- Posts: 84
- Joined: Sun Apr 11, 2010 10:43 am
Post
by relminator » Wed May 18, 2011 8:09 am
Learn:
Cross Product (Needed for fast "inside" triangle tests )
Dot Product + Plane Equation (Needed for quad/tri to point collisions modelling)
-
lazyprogramer
- Posts: 85
- Joined: Mon Sep 27, 2010 5:26 pm
Post
by lazyprogramer » Wed May 18, 2011 1:29 pm
Show us what you've tried.
Good idea WinterMute!
Just show us wath you 've tried then we will help you, okay?
Who is online
Users browsing this forum: No registered users and 3 guests