HZNM.COM
welcome to my space
X
Search:  
 HOME   RB: Sphere mapping?
RB: Sphere mapping?
Published by: wktd 2009-01-09
Welcome to:hznm.com

  • Hi everyone,

    I was wondering if it is possible to acheive a reflection map on objects using RB3D (quesa)? I'm not sure what the correct terminology is, but is it called a spheremap? All I want is a 2D texture shrinkrapped onto an object with the same orientation, no matter which way the object is facing. Can I acheive this by editing the 3DMF file, or do I need extra coding?
    Intermediate Physics for Medicine and Biology - Google Books Result::
    href=http://books.google.com/books?id=0ae76ia71u4C&pg=PA226&lpg=PA226&dq=RB:+Sphere+mapping%3F&source=web&ots=H444Ykme9d&sig=N0ZkE5vK2xbaDoS_cEgz_aztvt0&hl=en&sa=X&oi=book_result&resnum=25&ct=result class=l onmousedown=return clk(http://books.google.com/books?id=0ae76ia71u4C&pg=PA226&lpg=PA226&dq=RB:+Sphere+mapping%3F&source=web&ots=H444Ykme9d&sig=N0ZkE5vK2xbaDoS_cEgz_aztvt0&hl=en,,,res,38,)>Intermediate Physics for Medicine and Biology - Google Books Resultby Russell K. Hobbie - 1997 - Medical - 575 pagesA torque r on a small sphere of radius a in a medium of viscosity 77 causes the sphere . Body surface potential mapping. In DP Zipes and J. Jalife. eds.
    http://books.google.com/books?id=0ae76ia71u4C&pg=PA226&lpg=PA226&dq=RB:+Sphere+mapping?&source=web&ots=H444Ykme9d&sig=N0ZkE5vK2xbaDoS_cEgz_aztvt0&hl=en&sa=X&oi=book_result&resnum=25&ct=result
    HOME

    Sorry for the confusing question, but I'm sure someone out there will understand!
    Thanks


  • OpenGL has built-in support for generating texture coordinates for use with sphere maps.

    I don't know whether that's exposed in any way, shape or form by Quesa, though.

    If you look at the OpenGL specification, you should be able to find the mathematical formulae used to generate the sphere mapping texture coordinates, if that's useful to you.


  • Thanks to everyone for your help, especially to w_reade.

    Thanks also to monte, I'll see if I can find it.

    Baldock- unfortunately the Apple show was during the middle of my exam week; so I didnt have time to go. Did you go? What was it like?


  • Thanks for helping, but wow, that sounds extremely hard.

    I cant understand ProjectBuilder / Cocoa, but is this method similar to the method used in the UseSphereMap example in the GLUTexamples folder?

    Thanks


  • Originally posted by OneSadCookie

    I notice that there're a growing number of south-pacific-ers on this forum, though. I think so far I've counted five New Zealanders and four or five Australians. Maybe there's an opportunity there to have a south pacific Mac-Game-Dev meeting...

    This is going a bit off topic now, but I had thought of a Mac-Game-Dev meeting for us Oceanics as well, but we seem a bit spread out, aside from the two Adelaideans on this thread.


  • No not you OneSadCookie, your to much of a regular for me not to know were you are from. I just noticed that Cookie who started the thread was from Adelaide thats all.


  • Hello Cookie
    Did you go to the Apple show last month in Adelaide?


  • Sphere mapping is all very well, and useful in certain circumstances, but it won't give you reflections on anything except a sphere.

    it shouldn't be too tricky; let me try again.

    I'm assuming that you have, at each vertex, a normal vector and a pair of texture co-ordinates.

    Then, for each visible vertex, do the following:

    1: get a vector pointing from the camera to the vertex.

    2: reflect this vector in the plane defined by (perpendicular to) the vertex's normal.

    3: convert the resulting vector into spherical polar co-ordinates (without worrying about its magnitude).

    You'll end up with two numbers which represent, essentially, longitude and latitude - and so each one can be multiplied by some constant to give you u and v co-ordinates on a rectangular texture. Then just give your vertex the new texture coordinates, and render as normal.

    u = longitude * textureWidth/TwoPi
    v = (latitude + PiByTwo) * textureHeight/Pi

    (assuming you're using radians)

    Reflecting the vector shouldn't be too hard, and there must be any number of places on the web to tell you how to convert to spherical polar co-ordinates.

    I hope this helps.

    ps If you're programming in 3d it'd really help to learn some 3d vector maths, if you haven't already. It'll make things much easier.

    pps watch out: those polygons which cross over the horizontal edge of the map may (will) look funny if you don't do some extra checks. This should get you started, thoughÖ


  • Lucky for me the boss is a Apple/Mac fan so me and one of the other guys were allowed to knock off 1.5 hours early so we could go in to it. Wasn't to bad. Next time Apple have a developers night I'll have to remember to e-mail you, those nights are always a lot more interesting.


  • ok, I just looked up the reflection formula, 'cos it was bothering me. Here's how to do it:

    V = vector pointing from vertex to camera
    N = normal vector at vertex
    R = reflected vector

    R = (2N.V)N - V

    them convert R to spherical polar and you're away.

    ps if you know 3d maths already, sorry to be patronising. pls forgive:D

    [edit] I think V should be normalised. Presumably N is already.


  • You talking to me?

    No, Adelaide's a bit far & expensive, especially with a new computer in the house ;)

    I haven't even been as far as Auckland for an Apple event...

    I notice that there're a growing number of south-pacific-ers on this forum, though. I think so far I've counted five New Zealanders and four or five Australians. Maybe there's an opportunity there to have a south pacific Mac-Game-Dev meeting...


  • If you can get a hold of it (or maybe you already have it) the QD3D SDK had a couple of pdfs written by Brian Greenstone. One of them was called "Cool tricks" or something like that and had a section on achieving sphere mapping in QD3D. That might be a help.


  • If you want a reflection map, you won't be able to just shrinkwrap it onto the model, you'll need to take into account the orientations of the faces. This would probably be pretty damn slow, but you could bounce a ray off each vertex from the camera and see where it ends up "at infinity", and then recalculate the u,v co-ordinates based on this. (see your environment map shrinkwrapped onto an infinitely large sphere surrounding your scene, and get the texture coordinates from where the reflected ray intersects the sphere)

    Remember, if you use a square image, you'll probably get noticeable distortions at the top and bottom, I believe circular images are the way to go for nice-looking results. You may need two circular ones (one for northern, one for southern hemisphere) otherwise there'll be much more detail on one side.





  • How much does getting a small tattoo on your hip/stomach hurt?
    Do anyone else have an itchy anus? ?

    You are looking at:hznm.com's RB: Sphere mapping?, click hznm.com to home
  • milespree belly up
  • where s doc
  • win a chick fil a® party tray in the cow of the day contest
  • b1g1 a w rootbeer float to go with free sub
  • earthlink warning same old
  • ebay s anything points
  • mix98 5 freeloader prizes free
  • need pre paid calling card
  • posting to wrong group
  • link for easy free aa miles gmac quote has vanished
  • more free magazines
  • star registery
  • free sub to golf world
  • 5 mypoints for 30 second survey
  •  
  • at t the customer is always lying
  • my points down again
  • best deal on a cell phone
  • promo codes buy com dell amazon com b n etc
  • nathan s famous hot dogs 3 for only 2 99
  • great deal on panasonic
  • 5 mypoints daily
  • 500 hhonors points for survey
  • free beach ball
  • 7 11 is giving free slurpes on friday july 11
  • mypoints posting error
  • erewards hh 75 100 250 awards
  • anything free at amazon right now
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hznm.com        Site made:CFZ