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 Professional Discussion / Rotating around Camera?

Author
Message
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 23rd May 2010 14:20


If you run this code, it appears as if the box rotates around the camera instead of it's own centre. Is this correct?

Requires Matrix1 for the move camera up command.

Thanks.

Rawwrr. Sig Fail.
Newcastle is awesome
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th May 2010 13:03
Weird... it certainly looks like that's what is happening but if you REM the line where you set the camera orientation out it's clear that the cube is rotating correctly.

My guess is it's just an optical illusion!

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th May 2010 13:34
Hi all. I made this piece of code time ago...I hope it can help.

cheers.



I'm not a grumpy grandpa
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 25th May 2010 16:28
Add some delay so when there is a turn in some direction camera wont follow the cube at instant but smoothly.

Once i played with sin and cos and the cube i used rotate in such way that at certain speed it produces the illusion that the cube is bending i only managed to capture this with my camera because there was not actuall bending.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th May 2010 16:47
Smoothing can be achieved by checking your current camera position against its ideal position then only moving by a fraction of that amount:



luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 25th May 2010 16:56
Yeah that kill the effect

Btw baxslash what`s up with the sound/music snippets i posted are you using them?I made something for loading of sprites, again very simple.But i`m waiting for inspiration about loading,so i can add more to this and pack them in one snippet thread.Have you interested in it?It`s very good, at the begining i almost abandon the sprites because of sound issue with ram and vmemory.But it clean now when something used is deleted.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th May 2010 17:07
I've not used it yet but I'm working on something that might use it.

Give me a shout when you have something and I'll take a proper look!

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 25th May 2010 18:19
It must just be an illusion then ... It sure looks like it is. Thanks for clearing that up, and thanks baxslash for that smoothing code, i've always been meaning to do something like that, but never got round to it.

Rawwrr. Sig Fail.
Newcastle is awesome

Login to post a reply

Server time is: 2026-07-25 08:29:34
Your offset time is: 2026-07-25 08:29:34