11/14/2022 0 Comments Cs source textures drop box![]() Gl.Material(OpenGL.GL_FRONT_AND_BACK, OpenGL.GL_SHININESS, materialShininess) ![]() Gl.Light(OpenGL.GL_LIGHT0, OpenGL.GL_POSITION, lightPosition) Gl.Light(OpenGL.GL_LIGHT0, OpenGL.GL_AMBIENT, lightAmbient) SolarSystem.cs (basically a collection of everything above, enums aren't necessary, I left them cause they might be useful in the future) public class SolarSystem Gl.Vertex(starPos.X, starPos.Y, starPos.Z) Gl.QuadricTexture(quadric, (int) OpenGL.GL_TRUE) įor (var i = 0 i starPositions = new List() Gl.QuadricNormals(quadric, OpenGL.GLU_SMOOTH) _velocity = (float)Rng.NextDouble() * 0.3f Public Planet(float radius, PlanetTypes planetType, Position position, string texturePath, bool hasMoon) Private readonly PlanetTypes _planetType WinApi.SetCursorPos((int)Math.Round(pos.X), (int)Math.Round(pos.Y)) K = Math.Cos(((double)Slope).ToRadians()) J = Math.Sin(((double)Height).ToRadians()) I = -Math.Sin(((double)Slope).ToRadians()) Gl.LookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, 0, 1, 0) ![]() Private const float rotationSpeed = 0.25f Private static float centerX, centerY, centerZ The camera here will be as close to the tutorial as possible (FPS), but I got also dragging/scrolling system instead of this. If someone is willing to help and prefer to check application instead of reading code here, link is added below. ![]() Can somebody tell me what exactly I am doing wrong? I would appreciate some code. I want my camera to look at the sun, but all I am getting are some really weird angles of planets or nothing at all, it might not even be pure camera problem. I am currently learning OpenGL and I am trying to write simple solar system application similar to the one in tutorial, yet for some reason camera behavior is really weird and I am not sure what is causing this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |