g3n/engine

Camera Scale Barriers

Closed this issue · 2 comments

Hello,
I am curious if g3n's camera can handle really large scenes; imagine Kerbal Space Program.
I am making a scene using a scale-model Earth and space ship.
I make the globe based on the shaders.earth demo:

	geom := geometry.NewSphere(6357000, 32, 16)
	t.sphere = graphic.NewMesh(geom, matEarth)
	a.Scene().Add(t.sphere)

...and I'm unsure how to place or configure my camera in the scene to be able to see this globe.
I imagine some combination of SetNear, SetFar, and maybe ViewMatrix.
My code is here: https://github.com/assembleco/debris-space.0; I'm glad for any help.

I had no luck with either:

	a.camera.ViewMatrix(math32.NewMatrix4().MakeTranslation(-18, 0, 0))
	a.camera.SetPosition(-18, 0, 0)

Using a sphere radius of 4.

Hi @c4lliope ! Thanks for you interest in G3N.
I can't access the repo you linked. If the camera is facing the sphere then I you'd probably only need to modify the near and far planes to make sure the center of the sphere lies inside the camera frustum.