Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,789 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Rotate Camera/View Around Object? [Re: RealSerious3D] #367724
04/17/11 05:01
04/17/11 05:01
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Ah! Now I see. No, the word "action" is a command. The word "rotate" is what I named that command. When I attach the action "rotate" to an entity in WED then, when built and run, that entity rotates. That's how GameStudio knows which object to rotate (by attaching the action ROTATE to it).

Re: Rotate Camera/View Around Object? [Re: RealSerious3D] #367738
04/17/11 11:06
04/17/11 11:06
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Code:
action rotate()
{
	while(1)
	{
		if (mouse_left){
			my.pan += mouse_force.x;	// mouse movement changes PAN 
			my.tilt += mouse_force.y;	// mouse movement changes TILT
		}
		wait(1);
	}
}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Rotate Camera/View Around Object? [Re: Superku] #367743
04/17/11 13:34
04/17/11 13:34
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Well, that makes perfect sense (and works, too). Thanks. I must have been very, very tired last night. laugh

Re: Rotate Camera/View Around Object? [Re: RealSerious3D] #367745
04/17/11 13:36
04/17/11 13:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You may want to limit the tilt to -89...89, otherwise the pan-movement would be inversed then (if I'm not mistaken right now).

my.tilt += mouse_force.y;
my.tilt = clamp(my.tilt,-89,89);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Rotate Camera/View Around Object? [Re: Superku] #367746
04/17/11 14:35
04/17/11 14:35
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Quote:
You may want to limit the tilt to -89...89, otherwise the pan-movement would be inversed then (if I'm not mistaken right now).


Nope. Pan works correctly, but the tilt can switch depending on which direction the model is facing.

In any case, thanks for this, too. It is good to know about and all this helps me understand how scripting works a bit better. I've been doing graphics for so long and have been meaning to do a little coding for quite some time. So all this is helping.

Thanks!

Re: Rotate Camera/View Around Object? [Re: RealSerious3D] #367756
04/17/11 17:09
04/17/11 17:09
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Pan is automatically fixed when it gets higher than 360 or lower than 0. The only real worry is when something is based off the camera's pan or the camera's pan is based off of something that is not automatically fixed, then you'll get a weird reaction.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1