Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2006-05-24 06:59:15

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

ray-traced torus, scale+rotate+texture+tangent-space normal mapping

Ive finnaly got my ray-torus intersections working, and ive made a quick and messy sample program testing it all

there are two renderings of tori in the images, one shows a traditional style torus, except that it is stretched by a factor of 1.11 in z direction and 2.5 in y direction. The othere is what you get when the tube radius is more than the ring radius, and again is scaled.

I have also tested out texturing the tori, and applying a tangent space normal map, which requires finding the tangent vectors at a given point on the tori.

You can see the texture, the pink thingy at the bottom, along with the normal map im using

(is it just me or does the non-traditional looking torus look kind of like an apple (ignoring texture and normal maps))

View Image: MAP_normal.jpg View Image: ehm.jpg View Image: testor2.jpg View Image: testorus.jpg

Last edited by luca-deltodesco (2006-05-24 10:03:48)


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#2 2006-05-24 08:05:58

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,552

Re: ray-traced torus, scale+rotate+texture+tangent-space normal mapping

Lots of work I bet to create that program. 
How many kilobytes large is the source code you wrote?
What is this pink thing at
http://img409.imageshack.us/img409/1148/ehm0ut.jpg ??
I can see its shape applied onto the other 3-D objects if I flip back and forth.
Very interesting.

Last edited by John E. Franklin (2006-05-24 08:09:25)


igloo myrtilles fourmis

Offline

#3 2006-05-24 08:19:15

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: ray-traced torus, scale+rotate+texture+tangent-space normal mapping

John E. Franklin wrote:

Lots of work I bet to create that program. 
How many kilobytes large is the source code you wrote?
What is this pink thing at
http://img409.imageshack.us/img409/1148/ehm0ut.jpg ??
I can see its shape applied onto the other 3-D objects if I flip back and forth.
Very interesting.

Actually, this is a very messy program i quickly put together just to test the torus rendering, the source code is 10kb for the main cpp without about another 10kb of my own code for files containing a Matrix class, a vector class, and classes i made for loading bitmaps and for solving quartic equations.

the pink image is the texture im applying to the surface, i just used smudge tool in photoshop and added noise

Last edited by luca-deltodesco (2006-05-24 08:21:19)


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#4 2006-05-24 09:46:41

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,529

Re: ray-traced torus, scale+rotate+texture+tangent-space normal mapping

That is really Beautiful!

Could you use "Image Upload" to post these on the forum? In a year or so the imageshack images might be gone.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#5 2006-05-24 10:04:08

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: ray-traced torus, scale+rotate+texture+tangent-space normal mapping

MathsIsFun wrote:

That is really Beautiful!

Could you use "Image Upload" to post these on the forum? In a year or so the imageshack images might be gone.

done and done, ive rewritten the first post, using the uploaded images.


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

Board footer

Powered by FluxBB