2
\$\begingroup\$

I'm currently working on a hobby project which is a universe simulator (exclusive to stars) built in unity3D. In order to deal with the raw scale of the universe I'm trying to implement two co-ordinate systems.

In my project I have two cameras; camera1 is the first co-ordinate system where all stars are loaded as high detail 3D objects. While camera2 is used for gathering a list of points within this "extended" frustum. I want to display these stars from camera2 on the farplane of camera1 in a lowdetail 2d manner.

enter image description here

I'm new to game development so this may be completely wrong; my plan was to generate a mesh from all the points in cameras2 frustum (this mesh now respresents my points in world space). I have a variable that represents the conversionFactor between the two co-ordinate systems. I will convert this mesh into projection view using the my conversionFactor in the translation component.

I will display this projection view on my camera1 farplane selling the illusion of far away stars? Please let me know the flaws in my deisgn! any help is much appreciated

\$\endgroup\$
3
  • 1
    \$\begingroup\$ It's not clear to me what your actual question is, other than "please give me feedback about my design". Feedback type questions aren't really appropriate for the site, since they're opinion based and there's no correct answer. \$\endgroup\$
    – House
    May 4 '16 at 15:40
  • \$\begingroup\$ Adding to the previous comment, I would suggest that you change the title of the question: it has nothing to do with what the question is about. Regarding the question format, you surely should transform the question to be more focused on a doubt you have, not an asking for feedback on the design. But if you what you do want is to just get open feedback, I suggest you post the question at the forums at gamedev.net . There it could raise interesting discussions \$\endgroup\$
    – MAnd
    May 4 '16 at 16:19
  • \$\begingroup\$ Not quite an answer to your question, but rather a suggestion. Why don't you place the far away stars as an image on a skybox? \$\endgroup\$
    – Gato
    May 4 '16 at 17:43
-2
\$\begingroup\$

If you literally want to gather a list of points, it may make more sense to just use raycasts from Camera1's position to determine those points. To do this, you could instead have Camera2's frustrum be a collider, use Physics.RaycastAll from Camera1's position to each collision in the Camera2 collider, and the points you're looking for would be all the RaycastHits on the Camera2 collider.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It's not at all clear how raycasting to the star points (whose positions in space are known in advance) helps in rendering a distant starfield. \$\endgroup\$
    – DMGregory
    May 4 '16 at 16:49
  • \$\begingroup\$ The above method would allow "gathering a list of points" as OP mentions in the second paragraph, which would be in worldspace in the plane that defines the edge of Camera1's frustum. These points could be used to approximate these stars in a variety of ways, such as creating a black texture and dotting those relative points with white pixels. \$\endgroup\$ May 4 '16 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.