Search found 14 matches
- January 6th, 2020, 2:28 am
- Forum: Everything
- Topic: Z divide fundemental question
- Replies: 12
- Views: 7615
Re: Z divide fundemental question
ok, I'm still a bit confused. Just to be clear, my 10x10 is the frustum size, not the physical screen size. Just to insure we are are on the same page here, we still need to convert to the (in my case ) 640 by 480 physical screen. I'm actually still confused here. Let me ignore actual coordinates, a...
- January 5th, 2020, 2:53 am
- Forum: Everything
- Topic: Z divide fundemental question
- Replies: 12
- Views: 7615
Re: Z divide fundemental question
Oh, I do know how to use the debugger. Its just finding the right places to watch is difficult in the version of the demo that has this portion added. Its obscured (at least for me) by the shader system, and the fact that the geometry is loaded externally, rather than a simple in code defined cube f...
- January 5th, 2020, 2:50 am
- Forum: Everything
- Topic: Z divide fundemental question
- Replies: 12
- Views: 7615
Re: Z divide fundemental question
First off, sorry I didn't notice your lengthy response to the prior post. Slipped through the cracks in my haphazard world! Thanks for going to the effort! Bad form for me to not have noticed. Apologies. Also, I actually do consider aspect ration in my code. Just didn't here for simplicity. Ok, I wa...
- January 4th, 2020, 11:36 pm
- Forum: Everything
- Topic: Z divide fundemental question
- Replies: 12
- Views: 7615
Z divide fundemental question
I've asked this before, and usually get told to post my code. This is not a code problem, but a fundamental concept question. My code does exactly what I expect. Lets say my view frustum is 10 units wide, 10 units high, and ten units deep. Lets not do any FOV consideration, so near plane is 1; Lets ...
- November 28th, 2019, 4:46 am
- Forum: Everything
- Topic: how best to recalc surface normals
- Replies: 3
- Views: 2094
Re: how best to recalc surface normals
Ok, actually I am already using your first example's method in my code (all transformations are done to the same start point), so yeah, it was silly to imagine accumulated error.
As for translation, don't I avoid that by having the normal's w component be zero?
As for translation, don't I avoid that by having the normal's w component be zero?
- November 27th, 2019, 10:36 pm
- Forum: Everything
- Topic: how best to recalc surface normals
- Replies: 3
- Views: 2094
how best to recalc surface normals
Is it common to apply the same rotations and translations to you surface normals as the vertices, or is it better to calculate new ones AFTER said transformations? I currently do the latter, because I'm concerned that floating point rounding errors will, over time, cause the normals to no longer be ...
- November 27th, 2019, 2:20 am
- Forum: Everything
- Topic: W divide confusion
- Replies: 2
- Views: 1650
W divide confusion
Ok, I've asked this poorly before, but I'll give it another stab. Here is what I think to be correct: After the projection transform, my x and y have been scaled to NDC space, where coordinates on the view plane are from -1 to 1 in x and y Further, z coordinates are scaled to where , after a w divid...
- November 17th, 2019, 6:41 am
- Forum: Everything
- Topic: Yet ANOTHER projection question!
- Replies: 0
- Views: 18591
Yet ANOTHER projection question!
So I have the projection matrix up and running. Its in the standard form: [2n/w] [ 0.0 ] [0.0] [0.0] [ 0.0 ] [2n/h ] [0.0] [0.0] [ 0.0 ] [ 0.0 ] [ f/f-n] [ 1 ] [ 0.0 ] [ 0.0 ] [-nf/f-n] [0] So what I don't understand is this. X and Y will be scaled to -1 to 1 coordinates, as they should. Z will be s...
- November 17th, 2019, 4:23 am
- Forum: Everything
- Topic: Help with projection matrix (again :) )
- Replies: 3
- Views: 2161
Re: Help with projection matrix (again :) )
Here is a dumb question. As I understand, the near plane z is defined completely by the FOV. In my example, with a FOV of 100°, I got a distance of 1/tan(50) = .84 I am getting it correct to use that .84 as my 'n' variable, yes? Thus, objects at z=0 in viewspace would get translated -.84 by the proj...
- November 16th, 2019, 11:03 pm
- Forum: Everything
- Topic: Help with projection matrix (again :) )
- Replies: 3
- Views: 2161
Re: Help with projection matrix (again :) )
Ok, update: if I make sure my viewspace origin is at 0, it works. So, in my example, it would go from -15 to 15. Math works out now. What got me confused, is that my books seem to have a translation to a zero centred viewport as part of the initial, un-reduced equation. In actual code, I would have ...