• Jueves 28 de Marzo de 2024, 14:52

Autor Tema:  Empezar En 3d  (Leído 1289 veces)

bob esponja

  • Miembro MUY activo
  • ***
  • Mensajes: 411
    • Ver Perfil
    • http://marianoguerra.blogspot.com
Empezar En 3d
« en: Domingo 25 de Enero de 2004, 20:38 »
0
queria saber si alguien conoce una pagina o si sabe como hago para transladar coordenadas 3d a la pantalla, no quiero usar ninguna libreria agena ya tengo el modo grafico, se algebra de matrices etc etc. si alguien sabe ...
como hago para cambiar lña contraseña de esto?

www.esponjasdeguerra.8k.com

Ruben3d

  • Miembro HIPER activo
  • ****
  • Mensajes: 710
  • Nacionalidad: es
    • Ver Perfil
    • Web personal
Re: Empezar En 3d
« Respuesta #1 en: Domingo 25 de Enero de 2004, 21:21 »
0
Hola. Cómo proyectar coordenadas 3d a la pantalla, de manera muy simple, viene explicado aqui:
Citar
Perspective view is composed of two things: converting 3D coordinates into 2D coordinates (screen), and making the perspective view. To convert 3D to 2D, there is a simple equation:


X = x / z
Y = y / z


Where X, Y are your coordinates on the screen, and x,y,z is a 3D point.

The next part, making the perspective view. To explain this concept, look into a shiny door knob. See how your nose is 2x bigger than normal, and the rest of your face is smaller than normal. This is the fish eye concept. Having a fish eye view, is like an exaggerated perspective view. That is, things that are closer become bigger, and things that are farther become smaller. This concept is used to make 3D games look 3D and not flat. Although your screen is flat, perspective view creates a depth into your screen. To do this, you multiply the x and y by the width of your screen in pixels. That is if you are using 320x200 resolution, you would multiply it by 320, so your formula becomes:



X = 320 * x / z
Y = 320 * y / z


The reason why I choose the screen width is because it has to do with how far your face is from the screen. Have you ever tried while playing a 3D game to brind your head really close to the screen and really far from the screen? What you will notice is that the game does not look real anymore. It either looks fish eye (too close) or flat (too far). Using the screen width is a good ratio. That means your head is about a foot away from the screen, which is reasonably good.


Espero que te sirva.

Un saludo,

Ruben3d