Using Blitz3D need help with Entity & Mesh & Surface

Started by JBR, June 11, 2020, 00:56:41

Previous topic - Next topic

JBR

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

STEVIE G

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?

JBR

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.

JBR

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.

STEVIE G

Interesting concept - hex lines. Is this for 3d wireframe? Any screenshots?

JBR

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

Jim.

hosch

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
Wow this looks very cool! Reminds me of Elite. What are you planning to do with this?

JBR

Hopefully a game similar to the Elite style but more combatant.

Jim.

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb