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.

DarkBASIC Discussion / Camera commands and Objects

Author
Message
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 31st Jul 2003 19:20
Hi

Im farmiliar with all the camera motions you can do with DarkBasic, except for one. I can move the camera and rotate it wherever I want to, but I can't make the camera rotate in a circle around a playing field looking in the center all the time. For example:

position camera 200,100,100
for n = 0 to 180
move camera n
point camera 100,0,100
sync
next n

^^that doesn't work, the camera just moves forward. I don't know how to do it. I'm trying to make a Final fantasy style fight and I can't make the camera do this simple thing.

Also, how do I made a man's arms and legs move??? I have DoGA L3(unregistered though) and I can't make a mans limbs move. Anyone know any decent and LOW spec programs I could use please? PC's not exactly ace. anyone please? can't have a game with no movement can we
Spiderman
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location: Canada
Posted: 31st Jul 2003 19:25 Edited at: 31st Jul 2003 20:18
I don't know exactly how to do it either, but it has something to do with calculus. I've tried to figure that one out to, but I haven't learned anything about calculus in school yet, so I'm currently trying to teach myself from a book, but I got stuck at the part that starts using radians.

Ever thought of making your own animation program?

"If the theory doesn't fit the facts, change the facts" -Einstein
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:09
you will need to calculate the degrees to which the camera will move...so that you will end up with a set of points in a 360 degree patern that looks like it is moving in a circle, but the point you position it to look at will remain the same...

You may have to get the point of focus' location then you will need to get how many spots around the outside you will be moving through... so say its six and you are focusing on 0,0,0 you will want to have a distance of 60, so you will add 60 to the Z and X but not Y because it will be the height of the camera as it spins, not you are at 60,60 with the camera, now what you do is subtract the distance of the either the Z or X position by the amount of points, in this case 6, that will give you another point...now you will need to do the opposite to the other variable so instead of X use Z or vice versa, do this 6 times and you have a circle...so it will look like this...

(its on my next Post Below...)

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:16
believe me, i'm no mathematician (or speller) but i just had a play out of curiosity then, and this is what i came up with:

changeing the 2 90's in the (CAMERA ANGLE Y() - 90)'s seems to make it further away/closer. the box isnt spinning btw, the camera is.

hope this helps.
lecks.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:17 Edited at: 31st Jul 2003 21:19


See i never played with the wrapvalue so i dont know what it does...this is just how i thought the equation would work of the top of my head out of nowhere...so it may not work...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:25
ignore me, eddy sounds like he knows what he's talking about, i'm just playing

wrapvalue just makes a value between 0 and 360 (an angle), so if its 367, it changes it to 7, if its -7, it changes it to 353.

i didnt realise this until i was playing then, i'd written my own function to do this lol.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:44 Edited at: 31st Jul 2003 21:45
ok...huh...you didnt know what it was doin...i thought wrapvalue would do sumthin effective...so...maybe when i get home i will boot the old EIN.CALC and put in the command for Wrapvalue in a mathmatic interpretations so i can make some better code.

Did it work for anyone, you have to add alot of parts to it like the Y height...but other than the Camera positions for height thats a complete equation...i think...

It may move to fast so put a Wait or sumthin...or use alot of spots...more spots should also make it move smoother...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:48 Edited at: 31st Jul 2003 21:53
oops i messed the code up...



I reversed the Z and X for the Camera in the FOR NEXT part, after the CAMERA(X or Z)#=CAMERA(Opposite of the other Camera Z or X)#

OK, OK, thats not right either, gimme a second...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:53

camera stays at 60,5,60

camera didnt move

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:54
i know gimme a second Lecks, i forgot to do sumthin...im trying to figur out where the 360 goes now...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:55
CAMERAX#=CAMERAZ#-(POINTX#/SPOT#)
CAMERAZ#=CAMERAX#+(POINTZ#/SPOT#)

this wont do anything.
its the same as

60 or (CAMERAZ#=POINTZ#+DISTANCE#) -/+ (0 / 6)

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:56
ok sorry its 4am hurry up lol

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 21:58
this might help (im guessing you dont have db handy)
Quote: "NEWXVALUE()
This command will return a value that represents the new X position of a point in 3D space. This command is used in conjunction with NEWYVALUE and NEWZVALUE commands to move from one point in space to another point in space based on a specified angle. Rather than using COS/SIN maths, these commands simplify the task of moving coordinates within 3D space. The step value specifies how far in the specified direction you would like to calculate. The parameters should be specified using real numbers.

SYNTAX
Return Value=NEWXVALUE(Current X Value, Angle Value, Step Value)
"

same for y and z

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 21:59
AHA...I forgot to divide by 2



Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:00
Try that, it may work now...try turning the sync off and using a 2000 wait time...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:01
it still wont do anything
60 - ((0 /6)/2) = 60

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:03
yea i have sync on but a 1000 wait and printing positions.
stays at 60,5,60 (i position it at 5 on y)
divinding pointx by something should really crash, because u cant divide 0.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:04
i divided by 0...thats odd lemme recalculate this...0 where did i get that...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:06
ohhh!!!!!i mixed more up...my bad...



did that work...i changed the camera positions and the points where they get calculated...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:08
0 is the point your trying to rotate around
i changed it to 1 but im pretty sure it's not the desired effect.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:09
i know it moves at an angle instead of a circle...its in my head here movin around in at an angle...lemme give it 1 more go with the 360 in there...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:14
both axis's jump from negative to positive numbers, inside the box.
im not sure but i think the maths for this is pretty complicated.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:14
wait, im gonna go about it a different way im gonna say that the spot is the number of degrees you want it to move out of 360 in a distance...lemme make the formula...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:15

thats what ive got atm
ill try 1 more then i gotta sleep

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:16
yeah, its gonna be...im sure i have it now though, let me make a formula for this...so its gonna be the Spot is 6 out of 360 and to move to a spot in 360...it gotta be from the distance as well...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:24
Give this a try...if it doesnt work then switch the camera variables in the FOR NEXT loop so that the Xs and Zs match...




Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:25
if it is bumpy then then inc or dec the spot#

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:27 Edited at: 31st Jul 2003 22:29
wait i got it...divide by the SPOT# not 2...



This will work...if its slow inc the SPOT...or maybe thats DEC...actually i think maybe it should say...ill edit it here

Maybe i should Divide by the current Spot...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:29
it barely moves at all (like less than 1 unit) away from the object

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:31
same thing with dividing spot#, i think you're way off somehow

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:32 Edited at: 31st Jul 2003 22:34
wait
Use this T



Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:35
i edited that to use T as the movement and to use the T from 1 to SPOT instead of 0 cause thats what screwed it up...divided by 0 and it was reversed...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:35 Edited at: 31st Jul 2003 22:38
error divide by 0 when t starts at 2
when it starts at 1, its the slowly moving backward effect again

edit: err 0, not 2

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:39
ok i gotta go to bed.
we've managed to make this a hot topic and not get anything accomplished hehe.
the first code i posted did work, but i dont know if you have a choice in distance.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:39
umm...i figured it out it has to use Pi...can DB use pi...

You have (PI)R*R to get the circumferance then you tell it to multiply the point by the number of SPOT#s...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:42
3.141592 = pi or close enough

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:42
your code worked...ok then use that...i just dont have the mental capacity at the moment for this...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:44
ill come up with sumthin here in a second...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 31st Jul 2003 22:44
its not me that needs it. its Squall alias Leon.
cya round

my code sort of works but only at certain distances, it sort of orbits around or something. it was a fluke hehe.

Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 31st Jul 2003 22:59
Ok...i Give...i have this code at home i will post it when i get theyre in 3 hours...if its not been done...*sign*

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 31st Jul 2003 23:00
So far thanks again for you help!!

It's working a little so I'm going to work at it. Thank youuuuuuu!!!

Don't suppose anyone knows were I can get a modeler so i can make some characters? I dont get the whole 'Limb' thing :S

Squall / Leon
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 31st Jul 2003 23:11
ok, its not working...damn it...lol

Anymore ideas? hamster inside my heads knackered now...has given up on cameras lol

Appreciate the work guys
Eddie Gordo
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 1st Aug 2003 00:12
hold on i will give you the code in like 50 minutes...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 1st Aug 2003 13:14
Ok guys, THIS CODE WORKS!!!... but is jumpy a little. Anyone fancy making it smooth as a babies arse, by all means try work it please
Funky Frank
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Aug 2003 13:55
Not sure if this is what you want guys, but give it a try.
It will rotate the camera in a circle around a chosen point in space.

cheers

Funky Frank

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 1st Aug 2003 19:24
Squall:
to make it smoother, just add 'sync on' at the top. the only problem is it isnt rotating around the point, it's just giving that illusion by moving along the z axis pointing at the given spot. it fooled me until i read the code then ran it again
Funky Frank:
err how did you test this? I tried it with:

remstart
camdist# = distance you want camera from object
angstep# = how fast you want camera to rotate around object
objx# = target object x position
objy# = target object y position
objz# = target object z position
remend
set window on
sync on
sync rate 20
autocam off
make object cube 1,1
camdist# = 5
angstep# = 10
objx# = object position x(1)
objy# = object position y(1)
objz# = object position z(1)

for angle#=0 to 360 step angstep#
camx#=objx#+(cos(angle#)*camdist#)
camy#=objy# + 5: `a bit above the object
camz#=objz#+(sin(angle#)*camdist#)
position camera camx#,camy#,camz#
point camera objx#,objy#,objz#
set cursor 0,0
print camx#
print camy#
print camz#
sync
next angle#
[/CODE]
it seemed to change angles when i changed angstep#, but didnt move at all in the angstep# variable, but didnt move at all other than this.
like i said before in this thread, i'm no mathamatician, or speller, (and ill add programmer now), but this code does nothing for me. stays at the starting position.

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 1st Aug 2003 19:31
damn i always screw up the code/quote thingies in the forums hehe

Funky Frank
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Aug 2003 19:48
Lecks mate, my mistake, the FOR-NEXT loop doesnt like real numbers (i.e. variables ending in '#').

Try the attached code instead.

Funky Frank

Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 3rd Aug 2003 10:07
that did the job good work.
use that if you havent got it working yet squall

Red Giant 2183
22
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 7th Aug 2003 10:48
how about "turn camera left or turn camera right

Login to post a reply

Server time is: 2025-05-20 01:44:35
Your offset time is: 2025-05-20 01:44:35