Project texturing issue

Started by
24 comments, last by simotix 14 years, 5 months ago
Quote:Original post by Shael
Quote:Original post by simotix
Maybe I am not explaining it correctly, but I do not understand what is going on here

*** Source Snippet Removed ***

That is my main concern, understanding that code. I do not understand why those values were chosen, what they are doing there and how they can be defined. That is what I am looking to be answered.


Those values are simply the position of the "light" that is projecting the texture. Try to think of projective texturing as if it were a film projector projecting a film onto a canvas. You need to specify the position of this projector, the direction it will project images, and its field of view.

Theres no reason why you can't change those values (60,90,0), they simply define the projector to be 60 units to the right and 90 units up from the origin, and the origin is the position the projector is facing to place the projected image.

One thing to note, make sure "objectTransform" is the identity matrix.


I did make the light values to (0, -2, 0) for it to be above it. But what do you mean make sure objectTransform is the identity matrix? I currently move its position, then rotate it. Is that wrong?

Advertisement
Does anyone know what the issue may be? Surely somebody has read this chapter before, or may know the issue I am encountering.
I am still looking into this issue, does anyone know what the problem could be?
Has anyone been able to figure this out yet? I am still looking for the solution.
Does nobody know how to do projective texturing?
I am still looking into this issue, does anyone know what the problem could be?
Does anyone have any clue what the problem may be?
HAha what is that :)

Anyway, if you have not yet understood what D3DXMatrixLookAtLH and D3DXMatrixPerspectiveFovLH do, maybe you should start with something simpler than Projective Texture Mapping. Like setting a camera and move it around the scene.

I've learnt projective TMap while studying shadow maps. Things are not so difficul as they seem. Basically:
- for each pixel, obtain its screen space position
- by means of a matrix mul, compute its light space position
- project that pixel using the light projection matrix
- now you have clip space coordinates. Convert those to texture space coordinates ( * 0.5 + 0.5)
- now you can access to your goddamned texture :)

(stop pasting thousand of lines of code...)
Quote:Original post by NiGoea
HAha what is that :)

Anyway, if you have not yet understood what D3DXMatrixLookAtLH and D3DXMatrixPerspectiveFovLH do, maybe you should start with something simpler than Projective Texture Mapping. Like setting a camera and move it around the scene.

I've learnt projective TMap while studying shadow maps. Things are not so difficul as they seem. Basically:
- for each pixel, obtain its screen space position
- by means of a matrix mul, compute its light space position
- project that pixel using the light projection matrix
- now you have clip space coordinates. Convert those to texture space coordinates ( * 0.5 + 0.5)
- now you can access to your goddamned texture :)

(stop pasting thousand of lines of code...)



I do understand D3DXMatrixLookAtLH and D3DXMatrixPerspectiveFovLH, however, the problem is I do not understand what the problem is currently with the rest of the code. Everything "looks correct".

I am basically do exactly what you do

I am not pasting thousands of lines of code, I posted around ~250 which is exactly the code I am using to test. I was hoping that someone would load it into a file and also try testing. However, it has been a month later and nobody seems willing to help.
Does anyone know what the issue may be?

This topic is closed to new replies.

Advertisement