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 (OptimusPrime, AndrewAMD), 14,580 guests, and 5 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
Entity oriented by 2D? #224147
08/28/08 18:29
08/28/08 18:29
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
I was wondering if there is any easy way to orient entities through 2D like we do for a panel.

Imagine a space scene where a spaceship can travel in every 3D direction. Imagine now that we need to reach a certain spot and there is a little 3D arrow panning and tilting towards the spot we want to reach.

I've managed to get a 3D arrow in a corner of a camera but things get nasty when the camera tilts and i'm still working on that.

Basically, is there any way to load an entity in a panel or something simillar?

I hope you understand the problem, and i'm sure that your explanation will not only help me but several other users who are trying the very same thing.

Thanks a lot!

Last edited by ribsribs; 08/28/08 18:30.
Re: Entity oriented by 2D? [Re: ribsribs] #224164
08/28/08 20:28
08/28/08 20:28
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
You can't load entities into a panel.

Views are what you are after, you can define a new view and use it just like the camera. Search the manual for views.

Re: Entity oriented by 2D? [Re: DJBMASTER] #224169
08/28/08 20:43
08/28/08 20:43
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
Well, i do know how to use views, but i've only used it once.
Aren't the views just another cameras over the same 3D scene?
I just wanted the arrow not the whole scene from another point of view. And if i'm not mistaken, the views are rendered in rectangles and i need the arrow clean.
If you're saying that entities cannot be loaded into a panel, i'll have to rely on the old trigonometry. smile

Thanks a lot for your reply!

Re: Entity oriented by 2D? [Re: ribsribs] #224182
08/29/08 01:11
08/29/08 01:11

C
cemetarycat
Unregistered
cemetarycat
Unregistered
C




well hey,

the cats out of the litterbox...or the bag.
sorta speak. wink

here is something that may help you
and others here. I'm still learning and experimenting with it.

here are some pics








and here is the codez.
gimme da codez. smile

Code:
 //////////////////////////////
#include <acknex.h>
#include <default.c>
VECTOR* mv[3];


BMAP* babel="babylon11.jpg";


//define 'user-defined' function first......
//just the hearder definition.
//to be used in function main() and also in other functions too...
function clearscreen();


function move_picture() {

//vector components for background picture...	
//	mv.x=10;
//	mv.y=100;
//	mv.z=40;
	
	
	while(1) {
		
		  if (key_w)
		  {  
		  	     clearscreen();
		  	   vec_add(my.x,vector(2*time_step,0,0));
		  	   
		}
		  
		   
		  if (key_s) 
		  {
		  	    clearscreen();
		     vec_add(my.x, vector(-2*time_step,0,0));  
		    
     	}  
		  
		    //use first for the y vector component
		  
		   if (key_a) 
		   {	  	   clearscreen();	 
		   	  vec_add(my.y, vector(0, 2*time_step, 0));
		   	  	  
	   	}
		    
		   
		   
		   if (key_d) 
		   {	  	   clearscreen();	 
		   	  vec_add(my.y, vector(0, -2*time_step, 0 ));
		   	  	  
	   	}
		   
		   //use for the vector z componet
		   
		   if (key_z)
		   {
		   	 clearscreen();
		   	vec_add(my.z, vector(0, 0, 2*time_step));  	
		   }
		   
		  if (key_x)
		  {
		       clearscreen();
		      vec_add(my.z, vector(0,0, -2*time_step) );
		      
	     }     
	  
		 
		 
		 c_move (me, nullvector,  vector( mv.x, mv.y, mv.z), GLIDE);
		 wait(1);
	}
}

function clearscreen()
{
	
	//clears the screen to a black-full color
	//not 0,0,0 or empty transparent black color...
	//useful for clearing/erasing aftereffects of moving/rotating/transformations
	
	 vec_set(sky_color,vector(10,10,10));  
	 
	  return(1);	 
	
	
	
}

function main() {
	level_load ("");
	wait(2);	// wait until the level is loaded
	
	//or just call clear screen too but with vector(10,10,10)  ;)
	 vec_set(sky_color,vector(0,0,0)); // almost black sky
	 
	 //vector 300,100,0...the standard here.
   ent_create("babylon11.jpg", vector(10,100,40), move_picture);	
    //vec_set(camera.x, vector(-150, 10, 10));
	
	
	
	
   //	vec_set(camera.x, vector(-500, 0, -10));...the standard and works. ;)
   
     vec_set(camera.x, vector(-500, 0, -10));
	ent_create("RED_DRAGON.mdl", vector(-310, 0,-100),NULL);
	//ent_create("land.mdl", vector(-900,2000, -400),NULL);
}	



next logical steps.....use another entity function for the dragon and perhaps its own vectors and key controls too.


cheers



Re: Entity oriented by 2D? [Re: ] #224189
08/29/08 02:07
08/29/08 02:07
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
can't you just continually set its angle vectors to that point?

action arrow()
{
while(1)
{
vec_set(temp,point.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now arrow always looks at the point
wait(1);
}
}

if that doesn't work then try my.tilt or my.roll instead.


Last edited by DJBMASTER; 08/29/08 02:07.

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