Code archives/3D Graphics - Maths/Reflex V1.1

This code has been declared by its author to be Public Domain code.

Download source code

(Posted 22 years ago)
NOTE -> Source code removed due to legal reasons.

As I'm using it wholesale(Not .dlled) in a commercial project, the lib/source in all forms was/is declared public domain falsely.

So...you can't use it, even if you did download it/alter it. Sorry guys, I'll post something up cool to replace it soon :/
/SEE ABOVE.

Comments

puki
(Posted 22 years ago)
ooh, this looks good - I've not tried it but it sounds good.

Picklesworth
(Posted 22 years ago)
Great, thanks for releasing this.

Neochrome
(Posted 22 years ago)
example code with this in place?

joncom2000
(Posted 22 years ago)
Yes a simple example using inbuilt b3d meshs would do, just so we can see how to use it, would be helpful to us lesser mortals ;)

There's a ragdoll example around somewhere...

found it. This demo was wrote before FMC, meaning it's using a older version..but the gist of it is the say.

include "reflex.bb" ;This is the lib in the first post. Not a missing file.
SeedRnd MilliSecs()
Graphics3D 640,480,32,1
SetBuffer BackBuffer()
room=LoadMesh("area\test\start.b3d")

r2=room
HideEntity room
EntityAlpha room,0.1
ShowEntity room

If Not room End

ScaleEntity room,0.12,0.08,0.12
PositionEntity room,-17,0,0
RotateEntity room,0,-60,0
jointCollider(room)

vcam=CreateCamera()

man=CreatePivot()
l=CreateLight(2)
LightColor l,2,2,2
PositionEntity l,10,10,10

tow.joint=joint(0,0,3)
car =CreateCube()
FitMesh car,-1,0,-2,2,1,4

;Make man joints
mj.joint=joint(0,1,0,180)
arm1.joint=joint(-0.5,1.6,0,40)
arm2.joint=joint(0.5,1.6,0,40)
arm3.joint=joint(-0.9,1.2,0,30)
arm4.joint=joint(0.9,1.2,0,30)
leg1.joint=joint(-0.5,-1,0,40)
leg2.joint=joint(0.5,-1,0,40)
leg3.joint=joint(-0.5,-1.8,0,240)
leg4.joint=joint(0.5,-1.8,0,240)
dj1.joint=joint(-1,-0.5,1,40)
dj2.joint=joint(1,-0.5,1,40)
pelvis.joint=joint(0,0,0,20)
neck.joint=joint(0,2,0,10)
head.joint=joint(0,2.6,0,50)
moveJoints(0,10,0)
;--

connectJoint(head,neck)
connectJoint(neck,mj)
connectJoint(mj,pelvis)
connectJoint(neck,pelvis,0,True)
connectJoint(head,mj,0,True)
connectJoint(pelvis,leg1)
connectJoint(pelvis,leg2)
connectJoint(leg1,leg3)
connectJoint(leg2,leg4)
connectJoint(neck,arm1)
connectJoint(neck,arm2)
connectJoint(arm1,arm3)
connectJoint(arm2,arm4)
connectJoint(arm3,arm4,0,True)
connectJoint(arm4,arm3,0,True)
connectJoint(leg3,leg2,0,True)
connectJoint(leg4,leg1,0,True)
connectJoint(leg3,mj,0,True)
connectJoint(leg4,mj,0,True)
connectJoint(arm1,pelvis,0,1)
connectJoint(arm2,pelvis,0,1)
jointSpheres()
SetBuffer BackBuffer()
j.joint=First joint

FlushMouse 
pv=CreatePivot()
HideEntity car
CameraClsMode vcam,0,True
EntityAlpha room,0.1
EntityFX room,32
EntityAlpha room,0.1
EntityBlend room,1

Repeat
ae=90
PositionEntity vcam,-5,5,15
ec#=90

PointEntity vcam,man
PositionEntity l,Cos(ec)*10,15,Sin(ec)*10

;PositionEntity man,0,head\y,0

;PointEntity vcam,head\id[0]																																																			
PositionEntity car,mj\x,mj\y,mj\z
PositionEntity pv,mj\x,mj\y,mj\z
;PointEntity pv,front\id

;MoveMouse 320,
j=First joint
	;pushJoint(head,0,60,0)
	;pushJoint(neck,-MouseXSpeed()*2,0,MouseYSpeed()*2)
	pushJoint(head,-MouseXSpeed()*3,MouseDown(2)*160,MouseYSpeed()*3)
	If MouseDown(1) pushJoint(leg3,-MouseXSpeed()*3,MouseDown(1)*160,MouseYSpeed()*3)
	If MouseDown(3) pushJoint(arm3,-MouseXSpeed()*3,40,MouseYSpeed())
	timeScale=timeScale+MouseZSpeed()*0.01
;	pushJoint(leg2,0,Sin(va)*15,0)
	va=va+MouseXSpeed()
	va=va+MouseYSpeed()
	
	
	MoveMouse 320,240
	
	FlushMouse 
		
	
	For j.joint =Each joint

	
	;	If j\y<0.5
	;	j\oy=j\y
	;	Else
			j\yi=j\yi-8
	;	EndIf
	
		
	Next
	
	

	UpdateWorld
		
	updateJoints()
	RenderWorld
	
	;debugReflex2D(vcam)
	
	
	frames=frames+1
	ms=MilliSecs()
	If ms>ls
	 ls=ms+1000
	fps=frames
	frames=0
	EndIf
	
	Text 1,1,fps
	Rect MouseX(),MouseY(),5,5
	
	
Flip True
Until KeyDown(1)
End



Stevie G
(Posted 22 years ago)
Any chance of a model to try that out?

I used cubes dude, basically created a cube at each joint, made it the length of the joint along the Z axis, then pointed it at the joint it was connected to.

3d match stick man! if that interests you I'll post the old version of reflex that did this automatically..it's collision routines arn't as effective though.

Erroneouss
(Posted 22 years ago)
yes plz!!! old version plz!!!!!
very helpful!!!!!!
thank you thank u thank u!!!!!!!!!

Gup gap gum.

Here you go. This should work with the demo provided..it'll be an easy step to up to the new version.

Neochrome
(Posted 22 years ago)
what about a .zip?

Neochrome
(Posted 22 years ago)
what about a .zip?

What am I, a tailor? ;p

It's a shame this is presented in such a heavy manner, but the blame lays with the rubbish archive system this site has, not me.;) (if in doubt, blame everyone else :D)

Dp.

Hmm...joints....

Stevie G
(Posted 22 years ago)
I've tried putting everything together and it doesn't do much :( - not sure what the house model is supposed to look like either so just had a fliped cube.

Don't get me wrong - I'm sure this is good stuff and would be VV handy .. but as it stands it's too much hastle to integrate into any of my stuff. However, if you show us a proper demo of how you intended it to work ..... ;)

See above.

WildStorm
(Posted 22 years ago)
very cool thx!

Code Archives Forum