Jump to content


Photo

Help Me With Drawing Models


  • Please log in to reply
8 replies to this topic

#1 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 03 April 2008 - 02:12 AM

//////////////////step event, cuz the room start wasn't setting the variables
if room_start=0
{
	zstart=z;
	zend=z;

	//face is being used to turn movement on
	if face=1
		alarm[0]=50;
		
	room_start=1;
}

////////////////draw event
if point_distance(x+16,y+16,Man.x,Man.y)<global.draw_distance
{
	d3d_model_draw(spikes_model,x,y,z,spikes_tex);
	
	if !(z=zstart)
	{
		draw_set_color(c_black);
		d3d_model_draw(spikes_holes_model,x,y,zstart,-1);
		draw_set_color(c_white);
	}
}

i made two models, 1 are the spikes and the other are the holes

the models are made here in a different controller object

globalvar spikes_model;
globalvar spikes_holes_model;

spikes_model=d3d_model_create();
spikes_holes_model=d3d_model_create();


for(i=4;i<32;i+=8)
{
	for(a=4;a<32;a+=8)
	{	  
		d3d_model_cone(spikes_model,a-2,i-2,0,a+2,i+2,15,1,1,0,4);
		
		d3d_model_primitive_begin(spikes_holes_model,pr_trianglefan);
		
			d3d_model_vertex(spikes_holes_model,a+2,i,.5);
			d3d_model_vertex(spikes_holes_model,a,i+2,.5);
			d3d_model_vertex(spikes_holes_model,a-2,i,.5);
			d3d_model_vertex(spikes_holes_model,a,i-2,.5);
		
		d3d_model_primitive_end(spikes_holes_model);
	}
	
}

why do i see this on my screen??

Posted Image

the spikes on the right are moving up and down, left are suppose to stay still.

the shadow is on the water at z 0 but it should be at zstart, the z of the spikes. the spikes move up and down and use zstart to move to the correct position.

i dont want to give out any gmk's

i just want to know why the holes model is being drawn at 0 and not at zstart

if you dont know, just reply with a smart ass comment

Edited by slayer 64, 03 April 2008 - 03:35 AM.

  • 0

5y5rs3d.pngfg0UQNL.png


#2 Zelda4evr

Zelda4evr

    GMC Member

  • GMC Member
  • 615 posts
  • Version:Unknown

Posted 03 April 2008 - 04:03 AM

seems to me like you have, "set uninitialized variables as zero" turned on because i didn't see a z=? anywhere
  • 0

#3 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 03 April 2008 - 09:37 AM

i just want to know why the holes model is being drawn at 0 and not at zstart

Its a GM bug. In a "d3d_draw_model(...)" the "z" argument gets ignored and read as Zero.

You will have to use
d3d_transform_set_translation(x,y,z)
d3d_model_draw(spikes_model,0,0,0,spikes_tex);
d3d_transform_set_identity()
instead.
  • 0

#4 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 03 April 2008 - 02:52 PM

i just want to know why the holes model is being drawn at 0 and not at zstart

Its a GM bug. In a "d3d_draw_model(...)" the "z" argument gets ignored and read as Zero.

You will have to use
d3d_transform_set_translation(x,y,z)
d3d_model_draw(spikes_model,0,0,0,spikes_tex);
d3d_transform_set_identity()
instead.



what?! thats stupid

if that is the bug, then why is the spike model being drawn at z? shouldn't it be at 0 as well?

well your solution works. go do me a favor, go tell Mark Overmars to fix gm7, or release a service pack or something. that kind of error is just dumb

but my spike holes look fine now

Posted Image

oh and the z for the spikes is set by the z of the platform under them
  • 0

5y5rs3d.pngfg0UQNL.png


#5 ragarnak

ragarnak

    GMC Member

  • GMC Elder
  • 19468 posts
  • Version:GM8

Posted 03 April 2008 - 03:22 PM

what?! thats stupid

Why do you think its called a Bug ? :)

if that is the bug, then why is the spike model being drawn at z? shouldn't it be at 0 as well?

Well, you made me learn something new : Only the Z for the Primitives is ignored (your trianglefan), not for the basic shapes (block, ellipsoid, etc).
  • 0

#6 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 03 April 2008 - 04:05 PM

oh yea, i've got d3d_model_cone() and i've got primitives.

did u tell Mark to fix his primitives?
  • 0

5y5rs3d.pngfg0UQNL.png


#7 flexaplex

flexaplex

    GMC Member

  • Global Moderators
  • 4814 posts
  • Version:GM8

Posted 03 April 2008 - 04:13 PM

oh yea, i've got d3d_model_cone() and i've got primitives.

did u tell Mark to fix his primitives?

I had this problem a bit back and some people (actually it might of just been ragarnak) said they already knew about the bug, so it's been a known bug for a while. I'm not sure if Mark actually knows about it or not though, it's not exactly easy to get into contact with him.

edit: yes it was just ragarnak and he said this "its a known problem (although my knowledge about it is no more than a few months old, when I first saw it discussed)." that was posted in January.. so it probably hasn't actually been known that long.. Mark very well might not know about it. Perhaps you should try and contact him/YYG's yourself.

Edited by flexaplex, 03 April 2008 - 04:16 PM.

  • 0
:]

#8 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 03 April 2008 - 04:52 PM

ok i'll call him,

what's his number?
  • 0

5y5rs3d.pngfg0UQNL.png


#9 flexaplex

flexaplex

    GMC Member

  • Global Moderators
  • 4814 posts
  • Version:GM8

Posted 03 April 2008 - 04:56 PM

ok i'll call him,

what's his number?

999

You can contact YYG though (who are developing GM now really instead of Mark) at
Their glog, via email or via their submission form.
  • 0
:]