• 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.
Sign in to follow this  
Followers 0

Equation of cone along an arbitrary axis

1 post in this topic

Hi all.

I'm looking for an equation for a cone along an arbitrary axis and I've run a few Google searches, but haven't come across much except for:

"Let V be the vertex, A be a unit vector in the direction of the axis of rotation, and B,C be unit vectors such that A,B,C are mutually orthogonal. Let theta be the angle between the cone and the axis.
To get to an arbitrary point on the cone, we start at P, travel a length of s along the axis (where s is an arbitrary real number), and then travel a distance of s*sin(theta) in any direction perpendicular to the axis. An arbitrary direction perpendicular to A has the form B*cos(t) + C*sin(t), where t runs from 0 to 2?.
Putting this together gives us a parametrization of:
P + s * A + s * sin(theta) * (B * cos(t) + C * sin(t))."

I'm not sure how this fits into what I'd like to do though. Specifically, I'm attempting to find a way to construct a cone such that its vertex is at point [i]p[/i] = (p[sub]x[/sub],p[sub]y[/sub],p[sub]z[/sub]) and the cone runs tangent to a sphere with origin [i]o[/i] = (s[sub]x[/sub],s[sub]y[/sub],s[sub]z[/sub]) and radius [i]r[/i]. In other words, I want the cone to run along the axis defined by the vector [i]o[/i] - [i]p[/i], with height equal to the length of said vector and its base have radius [i]r[/i].

This is not homework. I'm going to use the cone to construct a circle on a plane that intersects with the cone. I know that the conic section formed by the cone-plane intersection will not be a perfect circle - I'm just interested in an approximation.

Thanks in advance.

Share this post

Link to post
Share on other sites
the parametric equation of a cone is : (x/a)^2 + (y/b)^2 = z^2 ,with this you can get an elliptic cone with radii a en b.

So the z will be the direction normal, x and y will be the vectors that are perpendicular to the normal.
I will call these variables x', y' and z'. And those will be the axes of the local frame of reference.

The only step you need to make at this point to get it to the 'normal' frame of reference is to get the projection of the local axes on the normal axes. So first you have to normalise all the local axes and the normal axes. And then you can take the dot products of each axes.

x' dot x * t + x' dot y * s + x' dot z * r = at + bs + cr, which is the direction of x'.
y' dot x * t + y' dot y * s + y' dot z * r = dt + es + fr, which is the direction of y'.
z' dot x * t + z' dot y * s + z' dot z * r = gt + hs + ir, which is the direction of z'.

here t, s and r are the variables which replaces the x,y and z from the cone equation. Because x,y and z are now used as axes (vectors ).

Now you just need to fill these in, in the cone equation. And you get:

( (at + bs + cr) / r_x )^2 + ( ( dt + es + fr ) / r_y) ^2 = ( gt + hs + ir )^2

And this equation then describes the random orientated cone around axes x', y' and z'.
To translate the cone with the vector ( v,w,u ) you just need to replace t with t - v; s with s - w; and z with z - u;

That's all. Hoped it helped.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0