Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 938 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Force Camera to View? [Re: RealSerious3D] #367766
04/17/11 18:26
04/17/11 18:26
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Okay. Code now looks like this:

Code:
//Rotate View Around Object Test
//View Object from Different Distances

//Images
BMAP* top_view_button = "top_button.jpg";
BMAP* bottom_view_button = "bottom_button.jpg";
BMAP* front_view_button = "front_button.jpg";
BMAP* back_view_button = "back_button.jpg";
BMAP* side_view_button = "side_button.jpg";
BMAP* d0_view_button = "d0_button.jpg";
BMAP* d1_view_button = "d1_button.jpg";
BMAP* d2_view_button = "d2_button.jpg";
BMAP* d3_view_button = "d3_button.jpg";

//View Button
void view_button(var num) {
	if(player){
		switch(num){
			case 1:
			vec_set(player.pan,vector(0,90,0)); //top view
			break;
			case 2:
			vec_set(player.pan,vector(0,-90,0)); //bottom view
			break;
			case 3:
			vec_set(player.pan,vector(180,0,0)); //front view
			break;
			case 4:
			vec_set(player.pan,vector(0,0,0)); //back view
			break;
			case 5:
			vec_set(player.pan,vector(90,0,0)); //side view
			break;
			case 6:
			player.x = 56; //d1 view
			break;
			case 7:
			player.x = 100; //d1 view
			break;
			case 8:
			player.x = 150; //d1 view
			break;
			case 9:
			player.x = 200; //d1 view
			break;
			
	}
	}
}

//Panel
PANEL* buttons = {
	button(0,0,top_view_button,top_view_button,top_view_button,view_button,null,null);
	button(0,36,bottom_view_button,bottom_view_button,bottom_view_button,view_button,null,null);
	button(0,72,front_view_button,front_view_button,front_view_button,view_button,null,null);
	button(0,108,back_view_button,back_view_button,back_view_button,view_button,null,null);
	button(0,144,side_view_button,side_view_button,side_view_button,view_button,null,null);
	button(0,180,d0_view_button,d0_view_button,d0_view_button,view_button,null,null);
	button(0,216,d1_view_button,d1_view_button,d1_view_button,view_button,null,null);
	button(0,252,d2_view_button,d2_view_button,d2_view_button,view_button,null,null);
	button(0,288,d3_view_button,d3_view_button,d3_view_button,view_button,null,null);
	Flags = SHOW;
}

//Rotate Action
action rotate()
{
	player = me;
	mouse_mode = 1;
	while(1)
	{
		if (mouse_left){
			my.pan += mouse_force.x;	// mouse movement changes PAN 
			//my.pan = clamp(my.pan,-189,189);
			my.tilt += mouse_force.y;	// mouse movement changes TILT
			//my.tilt = clamp(my.tilt,-89,89); 
		}
		vec_set(mouse_pos,mouse_cursor);
		wait(1);
	}
}



Now, that moves the object that the action is attached to (when it comes to the distance) and that's fine for this. However, is there a way to move the position? Or if I had a player instead of a POSITION in WED, could I move that instead of the entity being viewed?

Later, what I want to do is set up several different positions around an entity and then, via clicking a button, have the camera jump to this position.

<edit>

Just had an idea: Can I set up several POSITIONS in WED and then have my distance buttons switch the view to the appropriate position?

In other words, I have pos_000 and pos_001. How could I have one button force the view to pos_000 and another to pos_001?

Thanks! laugh

Re: Force Camera to View? [Re: RealSerious3D] #367779
04/17/11 22:32
04/17/11 22:32
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
A position is just a vector. So set up your positions and record the positions and have the player choose them using the buttons.


---------------------
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 | 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