Topic: Placing Object at a location on the screen.

I used the getWindowSale() function to do this:

windowSize = getWindowScale()
WIDTH = windowSize[1]
HEIGHT = windowSize[2]

CENTER = {WIDTH/2,HEIGHT/2}

Anyone know how I would place an object relative to a camera, at the center of the screen, or at any point?

Does getWindowScale() have anything to do with the camera? Or should I be using camera functions?

What purpose could getWindowSale() serve?

Re: Placing Object at a location on the screen.

you can use getUnProjectedPoint :
pos = getUnProjectedPoint(Camera, vec3(0.5, 0.5, 1))

Re: Placing Object at a location on the screen.

Thank you anael! I will see if this does what I need it to.

Edit: I can't get it to work. I did:

pos = getUnprojectedPoint(mainCamera,vec3(.5,.5,1))

Then:

setPosition(monkey,pos)

thinking that this should put the monkey at the center of the camera. Am I doing it right?

Last edited by Tutorial Doctor (2014-05-01 17:42:21)