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.

Newcomers DBPro Corner / Camera Orientated Rotation

Author
Message
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 23rd Nov 2005 22:06
Hello.

This is my first post on the forum: I'm in a rather dire situation. I'm having trouble making the camera rotate around an object (like the earth orbiting the sun). I've experimented with all the camera commands but to no avail. This program is for my computing project in Advanced Higher (Scotland). The game theory is outlined below.

Problem solving in Dark Basic has been most enjoyable, but I am stuck. I have included the source code. Anyone up for explaining to me how to do it and enlightening me as to why that method works? Efficiency is not very important as of yet, so doesn't matter if the code is large. It's the complexity that needs explaining. In fact, the more inefficient my code is, the more I can Evaluate in my project Evalutation stage .

Game Theory (Or Design):

3D Noughts and Crosses, a 3 x 3 x 3 cube. The textures change to X or O on each cube to represent the state. Once 3 cubes are aligned as X or O that counts as 3 in a row. The Camera should rotate around the central cube, allowing all cubes to be seen. Opacity and transparency can be included if necessary to see central cube. 2 Players click on the cubes in turn to play. Nothing fancy. The final solution must include file handling and search OR sorting algorithms. I intend to code these in using game saving or score saving and score sorting etc.
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 24th Nov 2005 00:22
For some reason the source code didn't post correctly I think. I'm attaching it to this post again to see if it works.
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 24th Nov 2005 12:21
:\ The source code didn't appear again: I'm going to post it within the post instead. Hope the forum formatting doesn't mess it up.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 24th Nov 2005 13:51
Ta-Daa:



This is just an example, replace the sun with whatever object you want the camera to be pointing at, and instead of making the earth positioned at the limb put the camera there and point the camera towards the sun.

- RUCCUS

= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 24th Nov 2005 17:59
Thank you for that. It was very useful in helping my understand the rotation of objects around each other. But it's not what I'm trying to solve.

I need to get a camera to rotate around the object: so instead of an "earth" it would be a camera. That camera needs to face the "sun" as well. I also slightly confused about limbs and the wrapvalue command. Can you enlighten me on them?
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 24th Nov 2005 22:53
Nothing to do with your case but the code has subroutines (camera_control and update_camera) that include rotation around the character (cone) by pressing b or n.
you can easily put the arrows in place of the letters.
The main camera routine is update_camera
The secret is to point the camera to the object (position) you want to rotate around. (in this case, the cone)
Run the code below, You may get some ideas to get applied to your code.
cheers

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 24th Nov 2005 22:59
Which is what I said, Im not going to give you the entire answer I want you to do some work. So like I said, replace the earth with the camera, and use point camera to point the camera toward the sun, replace the sun with whatever you want it to rotate around.

= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 25th Nov 2005 12:40
Woops. Pardon me, I didn't notice the part about the camera in your post Ruccus. Okay, thanks for this you two: I'll mess about with it to see if it works then reply back.
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 26th Nov 2005 18:58
I've integrated Ruccus' code into mine so that it works with it. It's working, but not precisely to my requirements. I have tinkered with the values, but I don't understand or know how to make it work the way I want it to. If you run the code first, I'll describe the problem. The only working function is the left key so far.



It rotates around the central cube, but changes distance as it circles around the rear of the cube formation. I would fix this myself, but I haven't a clue what limbs are, how it works here, etc. In fact, I don't even have a scooby how Ruccus' code works but it works.
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 30th Nov 2005 02:18
Anyone willing to lend a hand then?
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 30th Nov 2005 12:30
I seem to be having a one man conversation here. This thread has been pushed to the second page again. So again, I asking for some further help, as I am stuck: totally.
= HighXplosive =
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location:
Posted: 1st Dec 2005 12:25
"Refreshing" the topic once again: still stuck on the same thing. I've tried tinkering with the code a little bit still, to no avail.

Login to post a reply

Server time is: 2024-11-27 12:26:29
Your offset time is: 2024-11-27 12:26:29