Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[HELP] Foliage that is parallel with the camera #255895
03/13/09 09:57
03/13/09 09:57
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
I've been working on some foliage in maya the past few days, getting them to look right in-game is a really difficult task. I've tried planes, bent planes and all kind of stuff, it's still not what I had in mind.

So now I'd like to make the planes parallel with the camera instead pretty mush like Oblivion.

Right now I do not have any ideas on how to do that with a shader (if it's possible even). I'd like to have the trunk on a different MDL file as I'm using Slins normal map shader on it, and all the planes (leaves) in either one MDL file or have a single MDL plane and use some sort of a for loop which checks through either "bones" with names or vertexes and inserts them accordingly and then giving them each an action which has like my.pan = camera.x or something. But I guess that would be abit slow if I have like 50+ Trunks.

So does anyone know or have some ideas which could help me achieve this without shader programming as I have no clue about it or if the for loop idea would work?

Thanks in advance!

//Endu

Re: [HELP] Foliage that is parallel with the camera [Re: Enduriel] #255898
03/13/09 10:45
03/13/09 10:45
Joined: Sep 2008
Posts: 76
Max_Prower Offline
Junior Member
Max_Prower  Offline
Junior Member

Joined: Sep 2008
Posts: 76
If you mean foliage that always faces the camera, you could try a sprite. Just don't give it an angle of any kind and it will always turn to face the camera. If you wanted to make it impassable you could try making a cube and making it completely transparent.

Last edited by Max_Prower; 03/13/09 10:54.
Re: [HELP] Foliage that is parallel with the camera [Re: Max_Prower] #255910
03/13/09 12:01
03/13/09 12:01
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
I ment more like the leaves of a tree, like 50-100 planes with a 32 bit alpha texture that face the camera always, any ideas?

Re: [HELP] Foliage that is parallel with the camera [Re: Enduriel] #255979
03/13/09 22:42
03/13/09 22:42
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
Oh well, I fixed my problem with a for loop that checks through the vertexes and adds leaves to them accordingly, and then assigning an action that makes it always be parallell with the camera smile

Here is the code for the people who maybe wants it smile

Code:

STRING* leaf_string = "leaf.bmp"; //The leaf file, can be a plane mdl with alpha aswell
ENTITY* mdl_with_vertexes_only; 

action face_camera()
{
	while(1)
	{
		my.pan = camera.pan;
		my.tilt = camera.tilt;
	wait(1);
	}

}

function Add_leaf_to_vertex(ENTITY* ent)
{
  var i;
  for (i = ent_vertices(ent); i > 0; i--) // repeat until all vertices are checked
  {
    VECTOR v;
    vec_for_vertex(v, ent, i);
    ent_create(leaf_string,v,face_camera);
  }
} 

action tree() // Assign this to the mdl file that is supposed to have only vertexes
{
	mdl_with_vertexes_only = me;
	Add_leaf_to_vertex(me);
}


Re: [HELP] Foliage that is parallel with the camera [Re: Enduriel] #256408
03/16/09 17:21
03/16/09 17:21
Joined: Sep 2008
Posts: 76
Max_Prower Offline
Junior Member
Max_Prower  Offline
Junior Member

Joined: Sep 2008
Posts: 76
Congratulations! ^^


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