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

digitalerr0r

Circles

9 posts in this topic

Hey, I have a Question. How do I make a object to move around in cricles...let''s say the I have a Sun, and some planets...how can I then make the planets to move around the sun ? The =)
0

Share this post


Link to post
Share on other sites
look into using sin and cos

"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
0

Share this post


Link to post
Share on other sites
i think that it is the best thing to use the glRotate functions to rotate objects around a circle ...

the example of a solarsystem is good for explaining it ... may be you set the sun into the origin of the coordsystem ... then you declare a variable holding the angle of the planet and you increment it every frame ... you will give that variable as the angle parameter to the glRotate function ... but first you have to translate the object about the radius away from the origin with the glTranslate function after that you have to rotate ...

but you have to implement it the other way round ...

-> first rotate
-> than translate

...

hope it helps ... you can do it of course with the help of sin and cosine but therefore you have a lot of calculation that is not nessecary ...

cu


0

Share this post


Link to post
Share on other sites
ämm ...
whats about sin & cos ?
somewhere in the DrawGLScene

void DrawGLScene()
{

blabla;

rot += 0.001f; // Global Defined!! -> GLfloat rot = 0.0;

obejct.x = sin( rot / speed ) * Radius;
obejct.y = 0.0;
obejct.x = cos( rot / speed ) * Radius;

glTranslatef(obejct.x , obejct.y , obejct.z );

// The works!

blabla;

}
0

Share this post


Link to post
Share on other sites
i used:

x = (a)sin(time)
y = (b)cos(time)
glTranslate(x,y,z);

Vary the a and b vars and you come up with a ellipse.

If its just basic shaded spheres you really dont need to worry about rotating.

I actually have some elementry solar system code laying around, if you care to look at it.
(pdn@rmci.net)



I came, I saw, I got programmers block.
~V''''lion
0

Share this post


Link to post
Share on other sites
got it to work now, hehe...sin and cos are damn cool(and helpfull) =))

cya, and thx for all the replays!!§
0

Share this post


Link to post
Share on other sites
YEah helpfull but very slow... If you wish to do it the math way... Pre compute your angles in an array.

The Rotate and transalte method will be alot faster though.

1- Translate your sun to the "middle" of the scene.
2- For each planet push matrix stack glRotate and glTranslate pop matrix stack.

glTranslate // Transform Scene
glRotate // TrasnFor Scene
glScale // Transform Scene

glPushMatrix
glTranslate
draw sun

for each planet
{
glPushMatrix
glRotate
glTranslate
draw planet
glPopMatrix
}glPopMatrix



Edited by - ANSI2000 on October 22, 2001 4:01:51 PM
0

Share this post


Link to post
Share on other sites

Don''t know how complex your simulation will become- but here is 1 limitation I found myself:

Do the positioning of the objects yourself in OpenGL. This way you can do accurate depth testing of objects and force a proper draw order.

Here is my rant:

I have a OpenGL driven 3d engine and was developing an advanced blending effects demo. In this demo I had three objects, one blended textured quad in the center, one transparent quad in the back, and some texture text in the front. The entire scene was rotated using glRotate().
Everything would work fine until the object in the back was rotated in the front, then it would actually become solid and block the other objects. After struggling for a bit- I discovered the cause. I was using the GL standard DEPTH_TEST, and when the first object drawn is in the front, it cause the other objects to fail the DEPTH_TEST and not be rendered.
My FIX: Rotate/Transform the objects using matrix math (like OpenGL would)- then use fast sqrt functions to figure the depth and qsort the objects from back to front, so the draw order is always proper.

My two cents,
Ranger

0

Share this post


Link to post
Share on other sites
This post came at a good time. I am making a solar system demo right now, just the sun and 9 planets for now. I currently use glPop and glPush for each planet. Although, doesn''t all the pushing and popping add to the overall time?


-----------------------------
"There are ones that say they can and there are those who actually do."

"...u can not learn programming in a class, you have to learn it on your own."

0

Share this post


Link to post
Share on other sites