Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

C Coder

View Vector & Planet Sphere Data

This topic is 5407 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

I have a List of data for a Sphere and a View Matrix X_axis,Y_axis,Z_axis. I need to know how to determine which segment of my sphere is visible from the view point, without scanning through ALL of the sphere data and checking each point! My sphere is created by: SegInc = 10 Degrees etc etc (int Yang=0;Yang<180;Yang=Yang+SegInc) { (int Xang=0;Xang<360;Xang=Xang+SegInc) { ...Find X,Y,Z points and if visible draw surface segment! } } I need to know which segments to check for! So I dont neeed to check every point!!! Some sort of line intersection with a spheres surface maybe!!! Scan through whole data in 10degree steps and if visible then draw in more detial (ie 2degree segments)!! Any Ideas Please!

Share this post

Link to post
Share on other sites
If the size of each segment is 10 degrees, as indicated by your code, then the whole sphere is only 2*18*36 = 1296 faces. Trying to cull some of them is simply not worth the trouble - you will be far better off culling the whole sphere (if/when it''s not visible) and improving your geometry processing (i.e. use vertex buffers and so on).

If your sphere ever gets more detailed, and you want to cull sections of it, you will need to find a comfortable bounding volume (e.g. a bounding sphere) to your view frustum, and test the sphere againt that. You may want to find a more comfortable representation of the sphere, which will allow you to test its sections more easily (e.g. divide the sphere into larger sections, and test wherether each of these sections is visible).

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"

We come in peace... surrender or die!

Share this post

Link to post
Share on other sites
Thx 4 V reply, the 10 degrees was an example figure Not an actual one!

10degrees is the detail level at a distance; as I get closer I want to increase this to <1 degree, but to do this I need to narrow the data down and only compute the visible segments of the sphere, without the need to scan through all of the vertices.

e.g 1degree = 360*180 = 64000 vertices (NOT GOOD)

I was thinking of using 5/10 degrees to check 4 visibliity and then if visible calculate in more detail ie 1/2 degrees or less!

But i was wandering if there ws a math routine to pre determine which area of the sphere would be visible at close range!

I have a space scene with 11000 planets orbiting 1100 stars in my universe but am stuck with flying from space onto the planets surface!

Have just got a perlin noise routine working to calculate the planet surface detail, but only want to do this for this visible segments of the sphere?

Any ideas!

Share this post

Link to post
Share on other sites

  • 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!