Page MenuHome

getScreenPosition lags behind by a few frames
Closed, ArchivedPublic

Description

System Information
Windows 8, AMD 7950

Blender Version
2.73 offical


Short description of error
In the example you will see a red sphere in worldspace and its screen space position returned with getScreenPosition.
Ive set up a 2d filter which renders a white circle over the top and set to the position of the red sphere underneath using getScreenPosition. You can use the left and right arrow keys
to move the red sphere left and right you will see the white circle over the top lag behind by a few frames.

Ive purposely set the framerate low to make it easier to see as you move the sphere but it happens at high framerates to. Im thinking its either 2d filters and passed in uniforms not being updated correctly or it is infact getScreenPosition's problem.

Oh and same thing happens if I calculate a 3d objects worldspace position to screenspace myself using gluProject, so maybe not a problem with getScreenPosition?

Can anyone shine some light on the issue?

Event Timeline

Chris Smith (xonar) raised the priority of this task from to 90.
Chris Smith (xonar) updated the task description. (Show Details)
Chris Smith (xonar) edited a custom field.

Sorry wrong section. GameEngine related.

Sergey Sharybin (sergey) lowered the priority of this task from 90 to Normal.Jan 20 2015, 11:08 AM

I suspect this is because the positions set in Python are those before the motion actuators update the position that is rendered in red.

A workaround would be to do that: http://www.pasteall.org/blend/39000

When you do:

if left == active:

own.applyMovement((0.1, 0, 0), False)

This doesn't work...

this: http://www.pasteall.org/62288/diff seems to fix the problem (for both applyMovement (python) and actuators) but I don't know if it could generate other bugs. So it needs review (NodeUpdateGS(0.0f) in KX_GameObjec::ApplyMovement is a Tristan Porteries idea)... My testfile: http://www.pasteall.org/blend/39265

Ah no, it creates problems... What do you think about?

Aaron Carlisle (Blendify) changed the task status from Unknown Status to Unknown Status.Jun 29 2019, 2:19 AM
Aaron Carlisle (Blendify) claimed this task.

This task is being closed because the BGE has been removed in Blender 2.8.