Moderators: Despellanion, Dr. Best

Atarian
Advanced Member
Atarian
Advanced Member
Joined: November 11th, 2007, 6:52 am

November 12th, 2007, 6:33 am #41

ok
Quote
Like
Share

Linkin
Forum God
Linkin
Forum God
Joined: July 10th, 2007, 4:45 am

December 2nd, 2007, 11:41 pm #42

What would be the most effective way to do this for bulletholes?
Because youl have to be contantly checking for new bullet hit positions.

Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Quote
Like
Share

$pecter
Elite Member
$pecter
Elite Member
Joined: July 9th, 2007, 10:49 am

December 3rd, 2007, 4:59 am #43

Creating a bullet hole.
This will add a new model to the 'array'. Set the variables such as rotX, rotY, etc yourself.

Code: Select all

with(the_object_controlling_the_models)
{
object_no+=1;//assuming you're using the default variable
X[object_no]=random(4000)
Y[object_no]=random(4000)
Z[object_no]=GetTerrainHeightAtPos(terrain,X[object_no],Y[object_no])
rotX[object_no]=0;
rotY[object_no]=random(360);
rotZ[object_no]=0;
scalX[object_no]=10;
scalY[object_no]=10;
scalZ[object_no]=10;
Texture[object_no]=0;
//set all variables otherwise they will be treated as 0
IDs[object_no]=external_call(global.u3d_load_mesh,file,password);//load mesh

external_call(
global.u3d_model_step,
IDs[object_no],
X[object_no],
Y[object_no],
Z[object_no],
rotX[object_no],
rotY[object_no],
rotZ[object_no],
scalX[object_no],
scalY[object_no],
scalZ[object_no],
Texture[object_no]);//call step
}
Quote
Like
Share

Linkin
Forum God
Linkin
Forum God
Joined: July 10th, 2007, 4:45 am

December 3rd, 2007, 6:53 am #44

Ok how would i do this if its not a model but a polygon?

Edit: Does this look correct for a polygon?

Code: Select all

with(wl_bhole_creator)
{
object_no+=1;//assuming you're using the default variable
X[object_no]=argument0
Y[object_no]=argument1
Z[object_no]=GetTerrainHeightAtPos(obj_island,X[object_no],Y[object_no])
width[object_no]=.5+random(.15);
height[object_no]=.5+random(.15);
Texture[object_no]=503;
//Begin Polygon
IDs[object_no]=external_call(global.u3d_begin_polygon,4);
//Add Vertexs
IDs[object_no]=external_call(global.u3d_add_vertex,-width/2,-height/2,0,0,0);
IDs[object_no]=external_call(global.u3d_add_vertex,width/2,-height/2,0,1,0);
IDs[object_no]=external_call(global.u3d_add_vertex,width/2,height/2,0,1,1);
IDs[object_no]=external_call(global.u3d_add_vertex,-width/2,height/2,0,0,1);
//Create Polygon
IDs[object_no]=external_call(global.u3d_create_polygon);

external_call(
global.u3d_model_step,
IDs[object_no],
X[object_no],
Y[object_no],
Z[object_no],
rotX[object_no],
rotY[object_no],
rotZ[object_no],
scalX[object_no],
scalY[object_no],
scalZ[object_no],
Texture[object_no]);//call step
}
What do i put for the step event? Or do i just leave it as u3d_model_step?

Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Quote
Like
Share

$pecter
Elite Member
$pecter
Elite Member
Joined: July 9th, 2007, 10:49 am

December 4th, 2007, 5:23 am #45

I'm sorry, I don't know much about u3d. But your code looks alright.
In the create event you should have this.

Code: Select all

u3d_type=1;
1 is the identifier for a model you should change this to the identifier for polygons. Which I think is 10.

If you look in the original 'Step' script you will see that the code executed for polygons(10) is different than 'Step' for models. Use the code in there instead of the step code your using.
Quote
Like
Share

Terror Doctrine
Elite Member
Terror Doctrine
Elite Member
Joined: October 7th, 2007, 3:44 am

February 1st, 2008, 7:00 am #46

How would you code it for a billboard? This is what i have is it correct?

Code: Select all

texture=1;
object_no=10;

for(i=0;i<=object_no;i+=1;)
{
width=100;
height=200;
originx=.5;
originy=.5;
scalx+=scalx==0;
scaly+=scaly==0;
scalz+=scalz==0;
texx2+=texx1==texx2;
texy2+=texy1==texy2;
}

for (i=0; i<=object_no; i+=1){
X[i]=random(4000)
Y[i]=random(4000)
Z[i]=GetTerrainHeightAtPos(LandscapeMain,X[i],Y[i])
IDs[i]=external_call(global.u3d_create_billboard,width,height,originx,1-originy,partsx,partsy,texture,texx1,texy1,texx2,texy2);
}
u3d_type=11;
for(i=0;i<=object_no;i+=1;){
external_call(global.u3d_transform_primitive,u3d_index,
texture,X[i],Y[i],Z[i],rotx,roty,rotz,scalx,scaly,scalz);
}

Quote
Like
Share

Terror Doctrine
Elite Member
Terror Doctrine
Elite Member
Joined: October 7th, 2007, 3:44 am

February 2nd, 2008, 4:47 am #47

Anyone Help?
Quote
Like
Share

ninja
Elite Member
ninja
Elite Member
Joined: October 17th, 2006, 5:23 am

March 10th, 2008, 2:10 am #48

Wow, those trees look good, $pecter. This could definitely help me. By the way your example has excellent collision checking! :ph43r:

Maybe your next example could deal with the enemies line of sight, I'm having a lot of trouble with that. I keep hoping someone will respond to my forum post on the subject.
Quote
Like
Share

Reikyrr
Forum God
Reikyrr
Forum God
Joined: March 16th, 2008, 12:42 pm

August 22nd, 2008, 8:15 pm #49

Sorry for the monts old thread bump but i really like to point out that this works very well! I just got 280 000 + triangles with an accaptable framerate! make that 560 000 with an 15 fps
~Inspirational quote~
Quote
Like
Share

Andrew75
Forum God
Andrew75
Forum God
Joined: July 22nd, 2007, 3:46 am

August 27th, 2008, 3:34 pm #50

wow i didnt really pay attention to this example before, looks very usefull.
gana try it out ^___^

(SONIC CD REMIX)
check out my vids
http://www.youtube.com/profile?user=tuxmask75
Check out our projects vids
http://www.youtube.com/profile?user=AXSXProject
Quote
Like
Share