Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Fake plane rotation #382480
09/08/11 16:39
09/08/11 16:39
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I have top down camera (tilt -90) and I want to move camera's position and angles, so it will looks like plane is rotating.
I've archived that effect in X cord. by moving camera in X coordinates and changing it's tilt parameters, it looks good.
Now I want to make same on the Y coordinates, but ROLL doesn't work to realize that, how can I archive this?



Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Fake plane rotation [Re: 3run] #382502
09/08/11 19:49
09/08/11 19:49
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
If my explanation isn't good enough, please let me know, but don't keep silence!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Fake plane rotation [Re: 3run] #382504
09/08/11 20:02
09/08/11 20:02
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
var camera_roll = 0; // or call it "_pan"
...
vec_set(camera.pan,vector(0,-90,0));
ang_rotate(camera.pan,vector(camera_roll,0,0));

Should work!


"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: Fake plane rotation [Re: Superku] #382509
09/08/11 21:01
09/08/11 21:01
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
It doesn't work as it should. Probably I'm doing something wrong. I'll upload a small demo tomorow.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Fake plane rotation [Re: 3run] #382560
09/09/11 13:13
09/09/11 13:13
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Here is the example, I've made it in X coordinates and I want to make the same for Y coordinates:
Download link
I can already move camera at Y coordinates, I just need camera to rotate properly, ROLL doesn't help me.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Fake plane rotation [Re: 3run] #382562
09/09/11 13:20
09/09/11 13:20
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
It works, you've just left out the vec_set(...):

Click to reveal..
Code:
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
VECTOR dist;
VECTOR offset;
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
var cam_height = 400;
var cam_roll = 0;
var cam_tilt = 0;
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function set_camera() 
{
	camera.arc = 80;
	// UP and DOWN:
	cam_tilt -= 0.5 * mickey.y * time_step;
	cam_tilt = clamp(cam_tilt, -110, -70);
	// LEFT and RIGHT:
	cam_roll += 0.5 * mickey.x * time_step;
	cam_roll = clamp(cam_roll, -20, 40);
	vec_set(camera.pan,vector(0,cam_tilt,0));
	ang_rotate(camera.pan, vector(cam_roll, 0, 0));
	vec_set(camera.x,vector(my.x,my.y,my.z + cam_height));
}
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
action camera_pos()
{
	VECTOR temp;
	player = my;
	set(my, INVISIBLE | PASSABLE);
	camera.tilt = -90;
	while(1)
	{
		// DEBUG FPS:
		var fps;
		fps = (1 / time_frame) * 16;
		DEBUG_VAR(fps, 10);		
		// UP and DOWN:
		my.x = -(cam_tilt+90)*10;		
		// LEFT and RIGHT:
		my.y = -cam_roll*10;		
		set_camera();
		wait(1);
	}
}
///////////////////////////////////// ///////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
function main()
{
	fps_max = 60;
	video_set(800, 600, 32, 0);
	freeze_mode = 1;
	level_load("level.wmb");
	wait(3);
	freeze_mode = 0;
}
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////


I've made some small changes in camera_pos, too.


"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: Fake plane rotation [Re: Superku] #382579
09/09/11 17:18
09/09/11 17:18
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thanks, will give it a shot!

Edit: thanks a lot bro. Rotation works perfectly, didn't really like movement in camera_pos, but rotations are awesome laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

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

Gamestudio download | chip programmers | 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