Skip to main content
gamedev.net
🔒 Locked

Projection Formula bug?

Started by Andos Feb 26, 2003 at 3:15 AM 1 replies 550+ views
Original Post
Andos
Andos
I use the projection formula: Screen_X = 3D_X / 3D_Z * zoom + half_screen_with Screen_Y = 3D_Y / 3D_Z * zoom + half_screen_height I have read that this should work just as good as the other more complex one. It''s just that this doesn''t look right... I have to divide the Z by 200 or around so it look ok. So my formula looks like this: Screen_X = 3D_X / (3D_Z / 200) * zoom + half_screen_with Screen_Y = 3D_Y / (3D_Z / 200) * zoom + half_screen_height This does look OK to me but i can''t figure out why to divide with 200...
davepermen
davepermen
Screen_X = 3D_X / 3D_Z * zoom * half_screen_width + half_screen_width
Screen_Y = 3D_Y / 3D_Z * zoom * half_screen_height + half_screen_height

i thought its something like this? (note the *half-screen in the code)

sorry, messed it up with old raytracing rememberings.. there i wanted from screen to space.. so i filled in divisions.. what you want is to multiply by halfscreen..

"take a look around" - limp bizkit
www.google.com

[edited by - davepermen on February 26, 2003 12:16:34 PM]
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
Andos
Andos
I found out...
I don''t have to divide the z cords with 200... I just have to set the zoom to 200... Gosh i''m stupid...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.