Vector shapes

Moderator
Posts: 3,579
Joined: 2003.06
Post: #16
I think I see what you might be trying to go for but shouldn't it be:
glTranslatef(cpBodyGetPos(ball.body).x/size.width - 0.5*viewAspect, cpBodyGetPos(ball.body).y/size.height - 0.5, 0.0)

I don't know what "size" is referring to though.

Also, I still think you want the inverse of the ball motion.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #17
Thanks. I solved it. The answer is glTranslatef(0.5*viewAspect - cpBodyGetPos(ball.body).x/size.height, 0.5 - cpBodyGetPos(ball.body).y/size.height, 0.0).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Reflect a vector in relation to another vector ipeku 4 5,483 Dec 12, 2011 07:17 AM
Last Post: ipeku
  Origin problems - rotating shapes frances_farmer 1 2,570 Feb 10, 2007 08:08 AM
Last Post: unknown
  Rendering 2D Shadows for Convex Shapes Nick 16 9,892 Nov 28, 2006 11:50 AM
Last Post: memon