As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

halkun
Registered User regular

I want to start out saying that this is not a homework problem. It's a personal project I'm working on but need a bit of help on the math bit as I am very weak and haven't been in high school for over 25 years.

I'm making a celestial globe and I'm trying to map out the stars.

Now lots of the heavy math I've done myself. I downloaded a cool star catalog from Yale that had the stars in Right Ascension by Degrees. Using excel, I was able to convert that into X,Y, and Z coordinates by doing some polar conversion math I found online. I now have a celestial sphere, and can put a point on it where a star is located, but now It's a little more tricky

At each point of X,Y, and Z; I need to create a pentagon (even better an N-gon) of radius r using.... someway and then have the normal face the center of the sphere at 0,0,0. (Basically, at the sphere center, you should see the pentagon flat looking out)

In a nutshell a function to take an point of X,Y,Z, and Radius, and spit out 5 X,Y,Z vertices representing the points of the pentagon.

For the record, I have a basic idea how to do algebra, and I haven't seen trig in many, many moons. So, my math-fu is weak.

I'm making a celestial globe and I'm trying to map out the stars.

Now lots of the heavy math I've done myself. I downloaded a cool star catalog from Yale that had the stars in Right Ascension by Degrees. Using excel, I was able to convert that into X,Y, and Z coordinates by doing some polar conversion math I found online. I now have a celestial sphere, and can put a point on it where a star is located, but now It's a little more tricky

At each point of X,Y, and Z; I need to create a pentagon (even better an N-gon) of radius r using.... someway and then have the normal face the center of the sphere at 0,0,0. (Basically, at the sphere center, you should see the pentagon flat looking out)

In a nutshell a function to take an point of X,Y,Z, and Radius, and spit out 5 X,Y,Z vertices representing the points of the pentagon.

For the record, I have a basic idea how to do algebra, and I haven't seen trig in many, many moons. So, my math-fu is weak.

0

## Posts

apolygon that fits the criteria.This may be pretty difficult to do if you don't have trig. But I think the steps are:

1. Calculate the normal vector from the origin to the center point

2. Calculate the equation for the circle on the plane perpendicular to that normal vector, using the center point

3. The vertices of the polygon you want will touch that circle. Put one vertex at 0 degrees, then calculate the other points of the polygon -- divide 360° by the number of vertices/sides to get the needed angles and then plug those into the circle equation

The equations for the normal vector and the circle may be hard to understand with basic algebra and trig, though.

The steps are helpful though... I'll play with it tonight.

(Assuming the api you're using has an object rotation function.)

However I do have a little easier basic math I'm figuring out now.

Taking the values on the left, you can preform a calculation get the value on the right. I think it's a multiplier of some sort but I don't know how to derive what n should be. I tried looking up who to do this is Google, but I don't even know the name of this kind of a progression.

The idea is a feed a floating point number from 1 to 7 and it will spit out a number from 0.010 to 0.001 proportionally.

I know this is probably basic math stuff, and I can solve for n in each case, but not ... continually as a function(?)

halkunonArbitraryDescriptoronb Minimum output is 0.001

x Max input is 7

y Minumum input is 1

((n-y)/(x-y) * (a-b)) + b

So a-b is the range, and the position within it as a percentage is (n-y)/(x-y). Then you add the start point b.

ArbitraryDescriptoronhttp://imgur.com/a/dYSkP

The first is Orion, with icospheres different radii based on the magnitude

and the second is the globe showing 2500 of the 9100 stars (Anything Magnitude 5.3 and above.. I may go up to 6, but I think the sky may get too cluttered, and my system starts to chug after 4000 stars)

halkunonThat performance seems strangely low. Are you just building the scene via script and viewing this in Blender? Some game engine?

Keep in mind I'm also on a Core 2 Duo with 4 GB of ram.. I'm a little underpowered

halkunonI guess if it isn't really obvious, I'm making a physical celestial globe, the star map is just one of the "layers" I'll be adding to the final sphere texture. I'm using Blender to help with the projection.

halkunonI now have a globe with stars, coordinate lines, and borders. The math you were able to provide helped a lot!

Picture below:

https://blenderartists.org/forum/attachment.php?attachmentid=469945&d=1485751197