Plotting A 3D Ellipse

Blitz3D Forums/Blitz3D Programming/Plotting A 3D Ellipse

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

To be honest I didn't think this was what you meant.

Create texture automatically assumes full alpha on each pixel in the texture you have to go through the texture and set the alpha bit to 0 to mask it. See Ross C's code in the archives.

This is the kind of thing you want .. at least it'll get oyu on the right track.

Graphics3D 640,480,16,1

Global Camera = CreateCamera():PositionEntity Camera, 0,100,-200
Global Ellipse = CreateEllipse( 50 , 45 ):ScaleEntity Ellipse , 1,1,2
PointEntity Camera, Ellipse

While Not KeyDown(1)

	TurnEntity Ellipse ,1, 1, 0
	RenderWorld()
	Flip

Wend

;=========================================
;=========================================
;=========================================

Function CreateEllipse( r1# , r2# )

	mesh = CreateMesh()
	s = CreateSurface( mesh )

	For a1 = 0 To 359
		a2 = ( a1+1) Mod 360
		v0 = AddVertex( s, r1*Cos( a1 ) , 0 , r1*Sin( a1 ) ) 
		v1 = AddVertex( s, r1*Cos( a2 ) , 0, r1*Sin( a2 ) )
		v2 = AddVertex( s, r2*Cos( a2 ) , 0, r2*Sin( a2 ) )
		v3 = AddVertex( s, r2*Cos( a1 ), 0 , r2*Sin( a1 ) )
		AddTriangle s,v2,v1,v0
		AddTriangle s,v0,v3,v2
	Next

	EntityFX mesh , 16+1
	EntityAlpha mesh,.5
	Return mesh
		
End Function