• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

AbsolutDew

How do you find the slope of a 3D line?

4 posts in this topic

apparently it''s not as simple as i thought, I''ve had alot of trouble finding a formula, and was surprised to find no reference to it even in this forum.
0

Share this post


Link to post
Share on other sites
Assuming the line is made up of (x, y, z), and y is up, we need to take the offset along the x-z plane and divide it into the vertical offset, y.

so if you have two points, p1 and p2,

offset along x-z plane: sqrt((p2z - p1z)^2 + (p2x - p1x)^2)

slope = (p2y - p1y) / offset

Is that right? Anyone? I don't want to send anyone off a cliff here...

- Waverider

Edited by - Waverider on March 5, 2002 3:49:42 PM
0

Share this post


Link to post
Share on other sites
AFAIK there isn''t really any such thing as "slope" for a 3d line. I guess there is in the sense that there is a deltax, deltay, deltaz, but in 2d the slope would be m=deltay/deltax. Again, AFAIK there isn''t any formula that combines them. I guess you could say that your slope is the vector <deltax,deltay,deltaz>, but thats about it. You pull the deltax, deltay, deltaz out of the parametric form of your equation, for instance:

x=1+5t
y=2+2t
z=3-3t

the start point would be (1,2,3) (that is, the constant numbers in the equations). the direction vector, or "slope", would be <5,2,3> (the coefficients of t). If you don''t know this stuff, i suggest you pick up a good math book, actually calc books generally have these basics, but others (geom?) may have more in depth basic stuff.

0

Share this post


Link to post
Share on other sites
IIRC the slope of a line is the first order derivative of it''s formula. Offhand looking at AP''s post the only correction I would make is changing the sign of the z coefficient. But it''s been a while since I''ve done any 3d calculus.
0

Share this post


Link to post
Share on other sites
AP has it right. The term "slope" is really a 2D term. If you''re talking about, say, a 3D terrain, then you can say that you have two different slopes, one in the x direction and one in the y direction, with the slopes being dz/dx and dz/dy. (This assuming the terrain is laid out in the xy plane with height as z.

The parameteric equations based on "t" for which AP gives examples are in my opinion the right way to represent 3D lines. If you take those 3 equations:

  
x = 1 + 5t
y = 2 + 2t
z = 3 - 3t


and yank out the coefficients of t, and put them in a vector:

  
vector = (5, 2, -3)


then that vector points in the direction of the line. The offset coefficients just represent a coordinate on the line when t = 0. So its really analogous to the 2D "slope" except that you''re using this parameter value t instead of a coordinate x in the equation.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
0

Share this post


Link to post
Share on other sites