Movement Pegs

Blitz3D Forums/Blitz3D Programming/Movement Pegs

Picklesworth(Posted 2004) [#1]
Hey,
Does have any code to give away that builds and updates movement pegs in 3d (possibly with rotation capability too)? (you know, those things used in 3d modelling programs with 3 lines coming off of them so you can move stuff about) I tried my own, but they're darned evil, and also too big, so I could use a bit of extra help. They don't have to be 3d objects either (in fact, I like them better when they are not), but if you have anything at all to give away I'd love to see it.


John Blackledge(Posted 2004) [#2]
Yeah, I've seen them in SketchUp.
For texture aligning/stretching to faces they are awesome (but so are SketchUp's programmers).
I think they would be incredibly difficult to program.
We can only hope that one of the big brains in the Blitz community takes it as a personal challenge....


Picklesworth(Posted 2004) [#3]
Allright, fine, I'll do it myself!

Haven't got all the clicking stuff yet, but yah.
Graphics3D 800,600,False,2
SetBuffer BackBuffer()

cam = CreateCamera()
PositionEntity cam,0,0,-10

;movement pegs
Base = CreatePivot()
X = CreatePivot(Base)
PositionEntity X,2,0,0
Y = CreatePivot(Base)
PositionEntity Y,0,2,0
Z = CreatePivot(Base)
PositionEntity Z,1,1,2

TurnEntity Base,0,45,0

While Not KeyDown(1)
	entityproject(cam,base)
	BaseX = ProjectedX()
	BaseY = ProjectedY()

	entityproject(cam,X)
	Color 255,0,0
	Line BaseX,BaseY,ProjectedX(),ProjectedY()
	entityproject(cam,Y)
	Color 0,255,0
	Line BaseX,BaseY,ProjectedX(),ProjectedY()
	entityproject(cam,Z)
	Color 0,0,255
	Line BaseX,BaseY,ProjectedX(),ProjectedY()
	TurnEntity base,0,1,0
	
	Flip
	Cls
Wend
End

Function EntityProject(camera,entity)
	CameraProject camera,EntityX(entity),EntityY(entity),EntityZ(entity)
End Function


Now, I need help.
For some reason, the pivots aren't parenting to each other, and so I can't rotate the base and have the other X, Y, and Z points follow it (unless I use math). Does anyone have any idea why this is and how I can help it?