Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Something strange

Author
Message
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 20th Feb 2009 19:57 Edited at: 20th Feb 2009 19:59
Ok. I have created very very simple level of primitives:

Header:


Main cpp


What is bad? When I uncomment the Sphere Creation/position code my camera messes up. Dunno why.

Maybe some advice of how to make my level to increase degree by for example 45'degrees. I mean:

Now my level is:

________________


I want it to be like:
---/
--/
-/
/

It would be rolled by ~75 degrees. But every object. This is driving me crazy!

Thanks in advance!

~Murloc.

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Feb 2009 21:17
Quote: "When I uncomment the Sphere Creation/position code my camera messes up. Dunno why. "

dbAutoCamOff()

Quote: "It would be rolled by ~75 degrees. But every object."

My first thoughts are to combine all of your individual objects into a single object having each sphere as limbs.

Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 20th Feb 2009 21:21
Thanks! Ohh,it will be maybe nominated as 'the most stupid question ever' but what are limbs?

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Feb 2009 00:18
What you know as an object in the GDK is not as simple as you think. It's actually a hierarchy of structures.

At the top level, an object has rotation and position and a few other bits of info (transparency etc), but there is no mesh data at this level.

Within each object there can be 1 or more limbs. Each of these limbs also has a rotation and position relative to the object (ie, you rotate the object, the limbs rotate with it). Each of these limbs can also optionally have mesh data, textures, a shader and children limbs of their own - if you rotate/position the parent limbs, the child limbs move with it.

So when you dbMakeObjectBox, you have created an object with 1 limb (limb id=0) containing a box mesh.

Here's an example that you should play around with a little:


Stuff to try out:
- Add more limbs.
- Create different meshes and make them into limbs too.
- Link your limbs to other limbs.
- Rotate different limbs and see if they react as you thought they would.

Something to watch out for: Linking a limb can result in the re-ordering of the limbs if you are not careful. To avoid this, as soon as you add a new limb, add it's children immediately and link them immediately.

For your purposes though, you only need to understand the creation of a mesh, adding the mesh as a limb, and offsetting the limb within the object.

Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 21st Feb 2009 10:14
Thank you very much! Now I understand what Limbs are and how to use them,and where are they useful :3

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.

Login to post a reply

Server time is: 2024-11-25 15:39:04
Your offset time is: 2024-11-25 15:39:04