Box2D Forums

It is currently Thu May 23, 2013 7:03 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Nov 12, 2007 2:42 pm 
Offline

Joined: Mon Nov 12, 2007 1:48 am
Posts: 13
back when I was using a similar language to his, all we pretty much had to do was generate x,y coordinates, grab a rotation vector and display the sprites on screen. However I never used Box2D (still taking a look at the examples and slowly progressing on my port) - However, doesn't the settings header manage the coordinate scales and also pixel size for the library so you pretty much cut on the calculations later on?

I'd be glad to learn more :)


Top
 Profile  
 
PostPosted: Mon Nov 12, 2007 2:52 pm 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
Well what i'm struggling with is instead of using polygons with vertices
i'd like to use sprites (with the same shape as the underlying polygon)..
but the sprite takes a rotation and a position (world coordinates)
The problem is box2d gives the vertices for the polygon but i need
a world rotation and world center position. The problem for me is
when using compound shapes with local positions and rotations.
Mike


Top
 Profile  
 
PostPosted: Tue Nov 13, 2007 10:15 am 
Offline

Joined: Sun Sep 23, 2007 3:57 am
Posts: 70
Location: Here
@Mike950
Box2D gives the rotation and position as well ;) I just use that to rotate and position the sprites.


Top
 Profile  
 
PostPosted: Tue Nov 13, 2007 10:34 am 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
@Thanks Diggsey
I think you might run into problems though if you have a body
with compound shapes (specifically polygons) Since each shape
has a local rotation and position. But the rotation you're using
is for the body (i think?)..well..maybe you can test it for multiple
polygon shapes per body (a box will do since that's a poly)..
Just make sure each shape is offset from 0,0 some distance and has a local rotation
other than 0 if you test it.
The solution btw from Erin is to compose the shape's local transform with
the body world transform (i hope i got that right! :))..
Thanks!
Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group