Jump to content
  • Advertisement
Sign in to follow this  
kobingo

Nothing visible when camera is right above object

This topic is 4410 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If my camera target is at (0, 0, 0) and my camera position at (0, 0, -50) then everything renders correctly, but if I change my camera position to (0, 50, 0) (to be able to look straight down at an object) then nothing is visible at all, how come?

Share this post


Link to post
Share on other sites
Advertisement
The situation you've described isn't looking straight down, its looking downwards at a 45' angle.

Think about it.


EDIT: Also, I'm mentally challenged.

Share this post


Link to post
Share on other sites
Huh?

Camera position at (0, 50, 0)
Camera target at (0, 0, 0)

Isn't that looking straight down? I'm I thinking wrong?

Share this post


Link to post
Share on other sites
What API? I'm going to assume Direct3D because of the Z coordinate of the camera (Although I don't think it'll make a difference). What happens if you move the camera so it's at something like (0, 25, -25)? Is there a certain point at which the model vanishes?

Share this post


Link to post
Share on other sites
I'm using DirectX. It's visible from all directions except when looking straight down. When my target is (x=0, y=0, z=0) and my position is (x=0, y=<can be anything greater than 0>, z=0) nothing is visible.

Share this post


Link to post
Share on other sites
I bet your camera's up vector is set to (0, 1, 0), isn't it? The up vector should be perpendicular to the right and forwards vector, meaning it should be (0, 0, 1) if your camera is looking straight down.

Otherwise strange things happen [smile]

Share this post


Link to post
Share on other sites
yes if youre using glulookat (u can check out a possibler code source with mesa)
if u run through the figures u will see looking straight down with the crossproducts its not gonna work
u have to change the up angle (which is prolly ovekill)
or add a slight offset eg (0, 50, 0.001 )

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!