[Solved] Why perspective divide after applying inverse perspective transform?

Kc Able Asks: Why perspective divide after applying inverse perspective transform?
If we have a point in NDC space and we want to transform it to view space using inverse perspective projection, why do we need to apply perspective divide at the end? Shouldn’t it be perspective multiplication, since applying the forward perspective projection from view to NDC space has the perspective divide?

I found it here: OpenGL Project

Code:
float fragmentDepth = texture(depthTexture, texCoord).r;

// Normalized Device Coordinates (clip space)
vec4 ndc = vec4(texCoord.x * 2.0 - 1.0, texCoord.y * 2.0 - 1.0, 
            fragmentDepth * 2.0 - 1.0, 1.0);

// Transform to view space
vec3 vs_pos = homogenize(inverseProjectionMatrix * ndc);

where

Code:
vec3 homogenize(vec4 v) { return vec3((1.0 / v.w) * v); }

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.