Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
magicalblender
Sep 29, 2007
What's better, drawing pixels directly, or using textures? Poking around the OpenGL documentation, I see that I can put pixel data into a raster and glDrawPixels() it onto the screen. I can also put the pixel data onto a texture, put the texture on a quad, and put that onto the screen. If I'm just doing two-dimensional imaging, then which is preferable?

Also, am I crazy, or has the page for glutKeyboardUpFunc disappeared from the Opengl documentation? I could swear I was looking at it a couple weeks ago, but it isn't there now.

Adbot
ADBOT LOVES YOU

magicalblender
Sep 29, 2007

Luminous posted:

I have two points, which can be used to make some vector leading from one point to the other. I simply want to place my camera such that it is positioned at one of the points (easy!) and looking along the vector path (I thought it was easy?!).

What I need in terms of the rotation to look down the vector path is HPR (heading, pitch, roll).

heading and pitch are pretty simple to find with some trigonometry.



code:
hypotenuse = sqrt(dx*dx + dz*dz);
heading = atan2(dz, dx);
pitch = atan2(dy, hypotenuse);
Return values for atan2() are in the range [-pi, pi] so you may need to convert accordingly to your favorite angle measurement system.

Not sure how you'd find roll. Surely you'd need a separate "up" vector, but I forget what you do with it.

Sorry if this isn't what you're asking for. I don't know much about matrices, so that part of your question went over my head :saddowns:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply