Orbit Cam Rotation Problem?

Blitz3D Forums/Blitz3D Programming/Orbit Cam Rotation Problem?

Guy Fawkes(Posted 2014) [#1]
Hi all. I was working on my program, when I needed an orbit camera. Closest thing I found was this source which I only modified a little bit. Problem is, I can't get it to rotate up to 85.0 on the positive X-axis, 0.0 on the negative X-axis, and rotate the player around in a circle on the Y-axis both positive and negative. I also can't get the camera when dragged to < 0.0 to slowly zoom in to the player up to a certain distance. I almost have it working other than those couple things.

Here's the code:



Thank You so kindly! :)

Sincerely,

~GF


Bobysait(Posted 2014) [#2]
Hi.

I don't where the source come from, but there is probably something you should have copied too.

[code]PositionEntity CAMERApivot, x1+(Sin(a)*dis), y1+5, z1+(Cos(a)*dis)[/a]
the local variable "a" is undefined.
Check the original code and find what this "a" is supposed to be.


ps : If you want to debug faster, try and use an alternative IDE, like IDEal, and use the "Local" keyword to declare all your variables. Then, thanks to the syntax coloration, undeclared variables are highlighted, so you almost never fail on initialising a variable.


Guy Fawkes(Posted 2014) [#3]
Thanks, but I don't think "a" is that relevant. I just want to know why this camera tilts when I only want it to orbit around the player's pivot so it stays directly on the player when rotating.


Guy Fawkes(Posted 2014) [#4]
Fixed thanks to me.

It was missing PointEntity()...



~GF


Guy Fawkes(Posted 2014) [#5]
Ok guys. I THOUGHT it was over, but one more bug has arisen.. For some strange reason, the camera's roll value is not always 0.0, and I think it's throwing the orbit of the camera off. How would I stop this? Also, for some reason, the camera pitch is going beyond -85.0 & 85.0 on the X-Axis...

Here's the code:



Thank You so kindly! =)

Sincerely,

~GF


stayne(Posted 2014) [#6]
Maybe because there is no uncommented code that deals with -85 & 85?


Guy Fawkes(Posted 2014) [#7]
Perhaps that's commented out because I tried it and it still didn't stop it at 85 & -85....


stayne(Posted 2014) [#8]
Toss the a# handle up as text and see what it's doing then you'll know why.


stayne(Posted 2014) [#9]
Just realized most of that code is copied and pasted from Stevie G's code. You have absolutely no idea what is going on do you? I'm backing out of this one...you still do nothing after all this time but copy code, hack it up and then beg for help without even once trying to figure out why it didn't work in the first place. Seriously dude you need to find another hobby or stop wasting people's time.


Guy Fawkes(Posted 2014) [#10]
Stayne. Either help or leave and don't come back! I am TIRED of people like you hijacking my threads! This forum is FOR HELP! Not "Oh, I can come on here and act like a drunk & / or a jerk and I'm better than everyone else" & ruin everyone else who tries to get help you troll.. And don't you EVER tell me how to run my life AGAIN!

If you're gonna complain, leave. and I don't care what you say after this. I'm ignoring you for being a troll and a mean / rude person.


RGR(Posted 2014) [#11]
http://www.purebasic.fr/english/viewtopic.php?f=36&t=59954&start=30
Re: Basic Terrain Generator
Post by Mythros » 31 Jul 2014, 02:34

I learn differently than other people. I have autism. I have to see it visually in order to learn. If I see a 3D triangulation formula, I can manipulate it to work to my liking & then post it for other people to learn as well.

Not to *learn as well* - To ask to *fix it* is what you wanted to say, Thundros, Mythros, Guy Fawkes!

As stayne points out - you have no idea what you are doing. 3000 posts begging for help on the same piece of software (copied and pasted from all over the internet) which you claim YOU nearly have finished.

Instead of ignoring people you should ignore other peoples code and learn to write your own! Maybe then you start understanding what's going on.

And don't try with too many engines at the same time (Pure Basic, Blitz3D, MP3D, Hardwired, etc.) as long as you don't understand one of them.

I get steps 1 and 3, but step 2 partially eludes me. How would I check every minute for a different value & should this function be called in the main loop? If so, how?

Thank You so kindly, H&K!

http://www.blitzbasic.com/Community/posts.php?topic=102831
<3 Hardwired just keeps getting better and better. But Ploppy, did my last post make sense? :)

Thanks again Ploppy! =)

Sincerely,

~GF


http://www.purebasic.fr/english/viewtopic.php?f=27&t=43601&start=765#p449616

Re: MP3D Engine Alpha 32
Post by Mythros » Today, 02:12

Hi, @mpz! :) Is there any updates lately?

Thank You so kindly!

~Mythros



Stayne. Either help or leave and don't come back! I am TIRED of people like you hijacking my threads! This forum is FOR HELP! Not "Oh, I can come on here and act like a drunk & / or a jerk and I'm better than everyone else" & ruin everyone else who tries to get help you troll.. And don't you EVER tell me how to run my life AGAIN!

If you're gonna complain, leave. and I don't care what you say after this. I'm ignoring you for being a troll and a mean / rude person.

This is NOT your personal thread to hijack. If you're not going to be of any help & continue to whine and complain & try to put me down, then LEAVE this thread & DON'T come back! And I don't care WHAT you have to say after this post.


Finally stop telling people to leave *YOUR* threads! Kids like you begging instantly for help shouldn't have such a big mouth!

Thank You so kindly! =)


Guy Fawkes(Posted 2014) [#12]
Reported. I am SO sick of you rude trolls!


RGR(Posted 2014) [#13]
I hope you'll get the answer you owe ;-)


Guy Fawkes(Posted 2014) [#14]
LEAVE MY THREAD ALONE & DON'T EVER COME BACK!


stayne(Posted 2014) [#15]
Dude you have to leave. The text is bold, underlined and typed in all caps. Internet rules and all that.

Seriously... I guarantee you if everyone completely ignores him he will disappear (after he changes his name in desperation for the whatevereth time). It's strangely addictive though to come here and witness this stuff. I just hate seeing so many people waste their time.


Hardcoal(Posted 2014) [#16]
give the guy a break!


stayne(Posted 2014) [#17]
Buddy you brought up "a drunk" pretty quick. If you have issues with someone that was abusive, ignored you entirely or whatever you need to have it dealt with. Trust me. It's not going to go away until you do. You show a lot of signs for someone that fits the bill. I know how it is. Just think about that because apparently you have some demons in you that won't go away. None of us know a thing about you so we don't get it...but it is very obvious something is there. My email address is in my profile if you want to talk.


RemiD(Posted 2014) [#18]
I also don't understand why you still ask for help to fix your "modified code" after all these years.

My suggestion to you would be to stop using others people codes to make your apps/games. And only read others people codes to understand what they have done, then rewrite your own procedures/functions, one check/instruction at a time, so than you can be sure that it works as expected.

To do this you have to learn to debug your code :
Debuglog("Variable = "+Variable)
Flushkeys()
Waitkey()
or
Print("Variable = "+Variable)
Flushkeys()
Waitkey()

With this you will be able to know the value or each variable/entity and know when the code behaves correctly or not, and determine what are the possible sources of the error/bug, and be able fix it (when it is your mistake). You can do it by yourself, try it.


Rick Nasher(Posted 2014) [#19]
OK, people like to insult people that they feel insulted them first, but not realizing that's the same behavior they so dislike.

e.g.: "I hate aggressive people to such an extend that I become aggressive too!" <Beating the purpose; make love not war kids :-). Just not responding to each other at all would be the wiser thing or just help out anyway out of "shear goodness of heart". (please do not reply, just my 50cents of wisdom I'd like to share, to help you all reach peace of mind/lessen the frustration. lol)

Anyway perhaps this might be of use as it envolves orbiting an object too(and really I don't remember where/from who I got it from and shouldn't really matter if it helps, credits to whoever wrote it):




You can also try replacing the bits between the lines in the main loop with:


Hope it helps.


Guy Fawkes(Posted 2014) [#20]
Hi, Rick. Thank You. The lines you mentioned:

PositionEntity cone , Cos(angle)*OrbitRadius# , 0, Sin(angle)*OrbitRadius#
RotateEntity cone ,180,angle,0 ;correct orientation of object so it follows the orbit.


Doesn't rotate the camera. It gets the cone stuck in the sphere.


Guy Fawkes(Posted 2014) [#21]
Ok, so far, I've fixed every problem but two... I need the "CAMERApivot" to stop somehow rotating on its' Z-Axis & ONLY on its' X & Y Axis'. And when moving with the arrow keys and orbiting at the same time, the player's rotation / position should NOT be acting up.

Here's the code:



Thank You so kindly! =)

Sincerely,

~GF


RemiD(Posted 2014) [#22]
For this :

I also can't get the camera when dragged to < 0.0 to slowly zoom in to the player up to a certain distance.


What i would do is that after the player feet have been rotated, after his eyes have been rotated, i would linepick from his eyes to back and if a pickable is detected, move the camera from the eyes position orientation to slightly in front of the picked point.

There is an example here :
http://www.blitzbasic.com/codearcs/codearcs.php?code=2724


Guy Fawkes(Posted 2014) [#23]
Thanks Remi. Can you tell me why this camera's Z-Rotation is even changing at all? I need that stopped then I think the camera is stable.