• 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.

vinny_ys

Motion along an inclined plane that can be rotated along x and z axes

2 posts in this topic

Hi guys, i need an algorithm that can simulate the motion of an object along an inclined surface. The surface/plane can be rotated along the Z and X axes. How do i calculate the transition of frictional forces from static to kinetic. Right now this is how i do it but it is incomplete. /////////////// CODE ////////////////////////////////////////// float Fparallel = objectMass * gravity * sin(rotZ) ; float Fperpendi = objectMass * gravity * cos(rotZ) ; // calculate net Force acting on the object float fFnet = ( coefKineFriction * Fperpendi ) + Fparallel ; // calculate acceleration of the object float acceleration = fFnet / objectMass ; // calculate direction of acceleration Vector3D Vt = new Vector3D() ; Vector3D Va = new Vector3D() ; Vector3D Vp = new Vector3D(getSurfaceNormal()) ; Vt = V_GRAVITY.CrossProduct(Vp) ; Vt.Normalize() ; Va = Vt.CrossProduct(Vp) ; Va.Normalize() ; vAccelVec.Init(Va.x * acceleration * _time, Va.y * acceleration * _time, Va.z * acceleration * _time) ; vVelVec.Add(m_vAccelVec) ; vNewPos.x = vPrevPos.x + (vVelVec.x * _time) ; vNewPos.y = vPrevPos.y + (vVelVec.y * _time) ; vNewPos.z = vPrevPos.z + (vVelVec.z * _time) ; ///////////////////////////////////////////////////////////// In the snippet above i'm not checking if the initial force has exceeded the static frictional force. i.e Fnet > Mu_static * FNormal only then the object should move and Mu_static changes to Mu_kinetic once the object starts moving. I'm presume thats how i should do it. Also what about rotations along the X axes. Right now i calculate the Perpendicular and Parallel Forces only for Z axes. U can see that in the code snippet. Do i have to calculate Parallel and Perpendicular forces for each Azes seperately ? Any suggestion will be of great help Thanks Vinny Edited by - vinny_ys on August 2, 2001 1:27:01 AM
0

Share this post


Link to post
Share on other sites
> In the snippet above i''m not checking if the initial force has
> exceeded the static frictional force. i.e
> Fnet > Mu_static * FNormal

I think your calculation in the code is wrong: I think you need:

fFnet = Fparallel - ( coefKineFriction * Fperpendi );

i.e. this gives the force due to gravity but opposed by friciton.

If you do it this way the answer just drops out: If fFnet is negative the object just doesn''t start moving.

If the object can move freely you need something more complex: the net force is vector, with acceleration due to gravity down the slope and friction opposing the direction of motion.

> Do i have to calculate Parallel and Perpendicular forces for
> each Azes seperately ?

No: you can do all calculations in a coordinate free way, i.e. using just vectors and vector operations. Your code is already most of the way there, with gravity and the plane normal as vector inputs. There are other things you can do, such as use the inner product instead of sin and cos in the first two lines, and using vector scaling in the last eight lines.

As for whether/when to use static/dynamic friction, this is one of the trickiest questions in physics to answer. In theory there''s a simple dividung line between them, between situations where objects are moving and situations where they are not. But in a simulation it''s difficult to draw the line between such situations.

You approach sounds fine for your current simulation, but as you add in rotation and other more complex behaviour you may find it needs to be much more sophisticated.
0

Share this post


Link to post
Share on other sites
>I think your calculation in the code is wrong:
>I think you need:
>fFnet = Fparallel - ( coefKineFriction * Fperpendi );
>i.e. this gives the force due to gravity but opposed by >friciton.

Hey thanks for the correction. i could'nt figure out why the object moved in the opposite direction of the tilt i.e when i tilted the surface towards me, the object slided away from me.
That was bcos i was summing up the forces. With the formula correction u suggested the object is sliding in the right directions.

>If the object can move freely you need
>something more complex:
>the net force is vector, with acceleration
>due to gravity down the slope and friction
>opposing the direction of motion.

Okay say i were to convert the net force to a vector. How do i go bout doin that. Do i create a unit vector and scale it with the scalar value ( fFnet ) ?

>There are other things you can do, such as use the
>inner product instead of sin and cos in the
>first two lines

i didnt quiet get u. what is the inner product ?

i'm workin on the transition of Frictional force from static to kinetic.

i'll let u know once i get that working.

Thanks for the post

Edited by - vinny_ys on August 2, 2001 11:46:14 PM
0

Share this post


Link to post
Share on other sites