SyntaxBomb - Indie Coders

Languages & Coding => Blitz2D, BlitzPlus, Blitz3D => Topic started by: JBR on June 11, 2020, 00:56:41

Title: Using Blitz3D need help with Entity & Mesh & Surface
Post by: JBR on June 11, 2020, 00:56:41
I want to get the surface of an entity so I can read out the VertexX, etc.

When I was using miniB3d I cast lyne_surf = GetSurface( TMesh(lyne), 1 ) and it worked fine.

But Blitz3D does not allow this, and it throws up a MAV on the TFormPoint line.

Help. :-)




lyne = Make_Line_No_Triangles( ship\constant, A_Ref_Ship(ship\constant)\A_Lines_V0[kk], A_Ref_Ship(ship\constant)\A_Lines_V1[kk] , scale)

lyne_surf = GetSurface( lyne, 1 )

;vertices
;--------
For vert% = 0 To 12-1
TFormPoint VertexX(lyne_surf, vert), VertexY(lyne_surf, vert), VertexZ(line_surf, vert), lyne, 0 ; To the real world

VertexCoords all_lines_surface, kk*12 + vert, TFormedX(), TFormedY(), TFormedZ()
Next
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: STEVIE G on June 11, 2020, 07:26:26
Should work fine, assuming at least 12 verts have been created. I would check countvertices for that surface. You sure it's not the line below? Curious as to why you need 12 verts for a 3d line too?
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: JBR on June 11, 2020, 21:43:28
Hi Stevie,

12 verts to make a hexa-line.

Should work but it does not.

Would you like a look at the whole source?

Thanks, Jim.
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: JBR on June 11, 2020, 22:17:21
Hi, found the error :-[

TFormedZ was using line_surf where it should have been lyne_surf.

I did your countvertices and it was 12 then I saw the variable line_surf and realised ........

Thanks again, Jim.
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: STEVIE G on June 12, 2020, 09:17:14
Interesting concept - hex lines. Is this for 3d wireframe? Any screenshots?
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: JBR on June 12, 2020, 20:30:40
Hi, yes essentially the same as a one surface particle system but I'm drawing lines.

Beauty is I can update a ship a line at a time, or 4, or any number really.

I need to scale the lines depending on distance but want to avoid an entity for each line.

Here's a little demo of a craft.

https://www.youtube.com/watch?v=vSWWBrqUTTk (https://www.youtube.com/watch?v=vSWWBrqUTTk)

Jim.
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: hosch on June 13, 2020, 15:11:56
Quote from: JBR on June 12, 2020, 20:30:40
Hi, yes essentially the same as a one surface particle system but I'm drawing lines.

Beauty is I can update a ship a line at a time, or 4, or any number really.

I need to scale the lines depending on distance but want to avoid an entity for each line.

Here's a little demo of a craft.

https://www.youtube.com/watch?v=vSWWBrqUTTk (https://www.youtube.com/watch?v=vSWWBrqUTTk)
Wow this looks very cool! Reminds me of Elite. What are you planning to do with this?
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: JBR on June 13, 2020, 23:14:59
Hopefully a game similar to the Elite style but more combatant.

Jim.
Title: Re: Using Blitz3D need help with Entity & Mesh & Surface
Post by: Steve Elliott on June 13, 2020, 23:28:26
Loving the vectors!