Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 22 Feb 2000
Offline Last Active Sep 02 2014 05:12 AM

Posts I've Made

In Topic: Stereographic to CubeMap Conversion...

22 June 2013 - 09:44 PM

*le bumpy* biggrin.png

In Topic: How to have index.php load different content

30 April 2013 - 05:41 PM

Look into mod-rewrite.


mod-rewrite allows you to redirect the content into the same php handler, index.php for example, and you pass it the URL.


This is the basis for the MVC model.

Hopefully this link will get you started fast:


Good luck!

In Topic: Ray Tracing: Texture Map a Sphere

08 October 2012 - 08:23 AM

Bacterius: Ah, solved it! Also added matrix operations, and a rotation procedure, and was able to tilt the sphere by 30º, and saw that the texturing was all correct. No mirroring at the poles.

Can I bother you with a few questions?

1) Regarding colors, as I trace a ray through the scene, through reflections, textures, etc, for each step of the way how do I handle the computation of the final color?

I'm, for now, going with:

rgb_final = (rgb1 + rgb2) /2;
...basically averaging colors for each ray collision...

I've heard something about color multiplication, like so:
rgb_final = rgb1 * rgb2;

2) If I hit a reflective surface, should I follow the surface's Normal vector, or should I calculate the reflection as below?
R = 2(AP . N) x N - N

AP - Vector from view to Intersected Point, normalized
N - Normal Vector of the surface, normalized

3) Any online resources you advise?

Thank you! :D

In Topic: Ray Tracing: Texture Map a Sphere

02 October 2012 - 10:12 AM

Bacterius, thank you for your continued interest. I'll write a reply later when I get home with the code I'm using. Again, thank you.

In Topic: Ray Tracing: Texture Map a Sphere

01 October 2012 - 11:15 PM

Bacterius: Thanks for your reply. Offsetting my U coordinates allows me to rotate the sphere along the equator. The same does not work with the V register, as it puts the south pole along the equator, stretching it. My current textures are classic earth, moon, mars textures.

I have a screen shot here: http://www.positronicdreams.com/stuff/fup/_fileup/raytracing001.png

Everything seems perfect in that image, but it isn't. I can mess with the U coordinate, but I can't rotate the sphere or anything. In the link I provide as source, it seems that the equations take a north vector, a right vector, and a 3rd vector (cross-product of the first 2), so this would give us 3 axis to manipulate the sphere, but alas, whenever I mess with those, the resulting image has flaws, most common is texture mirroring along some axis on the sphere...

Ashaman73: Thanks for replying. I'm really set on doing classic texture mapping, onto a sphere. All I want is a good pointer where I can read up on this and get it right, or at least copy some code. I really don't want to do cube mapping at this time.