-
Posts
42 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Foolish
-
File Name: Tutorials 1-5: Test, Lights, Camera, Meshes, Bodies File Submitter: Foolish File Submitted: 14 Apr 2010 File Updated: 14 Apr 2010 File Category: BlitzMax Code Source code and resources Upated for LE 2.3 and BMAX 1.38 1 - Test 2 - Lights 3 - Camera Controls 4 - Intro to Meshes 5 - Intro to Bodies Click here to download this file
-
Will do.. It will take me another day to package them up.
-
Link to the post I was referencing I solved it by creating a pivot to parent the camera to. The camera movement is smooth now, but it is not as visually interesting. Using the pivot keeps the camera rigidly in place where using rotate and move entity makes it feel more fluid.
-
The last time I went through them was for version 2.27. I have bmax code for the first 17 of them.
-
Okay. Framework got the effects I was looking for. However, it seems to have screwed up my 3rd person camera I was using. Going through the forums, it looked like you might have run into something similiar in January. I am using the same technique as described in that thread which is as follows: 'Position Camera PositionEntity(fw.Main.camera, EntityPosition(thismodel.model)) RotateEntity(fw.Main.camera, EntityRotation(thismodel.model)) MoveEntity(fw.Main.camera, Vec3(0, 1, - 2.5)) However, my model looks like it is shaking. In reality, it appears to be due to the camera positioning. Any thoughts? Thanks
-
I am in the process of trying to add a bloom or glow effect to a laser. Could someone comment on the following if they see something obviously wrong? I am an SDK 2.3 owner by the way. Thanks Here is my simple test program: Framework leadwerks.engine 'Create an OpenGL graphics window Graphics 800, 600 'Allows the engine to find files and load files from zip packages RegisterAbstractPath AppDir 'Create a world If Not CreateWorld() RuntimeError "Failed to create world." 'Create a camera cam:TCamera = CreateCamera() CameraClearColor(cam, Vec4(0, 0, 0, 1)) RotateEntity(cam, Vec3(35, 0, 0)) MoveEntity cam, Vec3(0, 0, - 2) 'add a light light:TLight = CreateDirectionalLight() RotateEntity light, Vec3(45, 45, 0) buffer:TBuffer = CreateBuffer(800, 600, BUFFER_COLOR | BUFFER_DEPTH | BUFFER_NORMAL | BUFFER_COLOR1) 'Create a render buffer For post - processing effects postbuffer:TBuffer = CreateBuffer(800, 600, BUFFER_COLOR) TextureFilter(GetColorBuffer(postbuffer), TEXFILTER_SMOOTH) postfilter:TShader = LoadShader("abstract::postfilter.vert", "abstract::postfilter_bloom.frag") DebugLights(True) mesh1:TMesh = LoadMesh("laser_laser.gmf") If Not mesh1 RuntimeError "Failed to laser mesh" PositionEntity mesh1, Vec3(0, 0, 0) 'Main loop While Not KeyHit(KEY_ESCAPE) TurnEntity mesh1, Vec3(0, 0.5, 0) 'Update timing, physics, and other miscellaneous updates UpdateWorld 'Draw the world SetBuffer(buffer) RenderWorld SetBuffer(postbuffer) RenderLights(buffer) SetBuffer(BackBuffer()) SetShader(postfilter) BindTexture(GetDepthBuffer(buffer), 1) BindTexture(GetColorBuffer(postbuffer, 1), 0) DrawImage(GetColorBuffer(postbuffer), 0, GraphicsHeight(), GraphicsWidth(), - GraphicsHeight()) Flip Wend And my mat file for the laser appears as follows: texture0="abstract::laserred.dds" clamp0=0,0,0 blend=0 depthmask=1 depthtest=1 overlay=0 zsort=0 cullface=1 castshadows=1 specular=0.000000000 bumpscale=0.300000012 gloss=0.250000000 shader="abstract::mesh_diffuse.vert","abstract::postfilter_bloom.frag" shadowshader="abstract::mesh_diffuse.vert",""
-
Since my projects are small and I am a one man show with Blitzmax and the nice BlIDE IDE, I haven't jumped into it too much. It's good to have another tool in the toolshed though.
-
I changed directions a little bit and started focusing on piloting the ship manually as opposed to workign on AI controlled ships first. So getting some basics down were pretty easy. The third person cam was just: 'Position Camera PositionEntity(cam, EntityPosition(thismodel.model)) RotateEntity(cam, EntityRotation(thismodel.model)) MoveEntity(cam, Vec3(0, 1, - 2.5)) I have a Type for my TIE Fighter. The model needed the following characteristics: EntityType model, 1 SetBodyMass model, 10 SetBodyDamping(model, 1, 2) The first param is linear damping and the second is angular. SetBodyGravityMode model, False 'no falling in space. SetBodyFriction (model, 0, 0) In the update method, I just use the following to steer: pitch = (KeyDown(KEY_UP) - KeyDown(KEY_DOWN)) * 200 yaw = (KeyDown(KEY_RIGHT) - KeyDown(KEY_LEFT)) * 200 roll = (KeyDown(KEY_Z) - KeyDown(KEY_X)) * 250 AddBodyForce(model, Vec3(0, 0, 700), 0) AddBodyTorque model, Vec3(pitch, yaw, roll), 0 The AddBodyForce is thrust and the torque obviously impacts the orientation. Using physics forces on Star Wars ships makes for an interesting flight experience that I think will make the dog fighting interesting. The attached screenshot shows my place holder graphics of a TIE fighter flying over the Death Star surface.
-
I bet it will be familiar. I am using a TIE Fighter from the classic Star Wars trilogy. I will get that image in here ASAP. In the meantime, I have playing around with the CalcBodyVelocity and SetBodyVelocity. I added a list of waypoints for the TIE Figher to follow. Unforunately, I can't figure out how to set a "constant velocity". My ship is decelerating as it gets close to the waypoint. My logic is as follows. 1. Identify the next way point. 2. Calculate the velocity. Set the velocity. Note that I calc and set the velocity once for each waypoint. 3. Each update cycle, check to see if my distance from the pivot is <=1. If so, go back to step 1. Overall, this is probably not the way to do it, but I am still playing.
-
Okay, I'm onto something now. CalcBodyVelocity lets me get a vector for the velocity to a position I give it. Progress.
-
One of the problems getting out the starting gate for me has been these simple navigation issues. There aren't really to many examples to learn from. Right now, I am trying to move a spaceship in 3D space. I can certainly move it using things like setvelocity, but its been difficult to figure out how to navigate to a specific point. With all of the complex problems people discuss on the forums, maybe this is too simple? In two dimensions, I suppose I can figure out the angle using the arctangent. In 3 dimensions, I guess this would be something similiar. Then I guess I can use set velocity. These things will get me from point a to point b, but then I need to apply a torque to get the ship to rotate and face the direction of movement. I was thinking that to keep the ship facing the right direction I would be continuously checking the angle and adding torque to keep pitch and roll where they need to be. Anyway, if anybody has done this before and can validate this approach, let me know. Better yet, if you have an example, I wouldn't mind seeing that either.
-
Thanks Rick. I think I saw you had a post on this somewhere. I'll see if I can find it again. Also, I was checking out your latest Thingoid video. Good stuff I am looking forward to checking out further.
-
I have been mining the forums for information on how to move objects in 3D space. I thought it was a significant enough topic to merit its own space. For example, if I have two objects and I want to move object A to Object B's location. Is there an easy way to determine the vector I would need to set for SetBodyVelocity or even MoveEntity if I wasn't using Physics?
-
Dark matter still sounds to me like a mathematical work around to me. ...Kind of like the "superluminous ether" that was conjured to define a medium for light to travel through. This was before Maxwell came up with the laws that related Electricity and Magnetism. Also, the effects you are talking about would have to be so small that its not necessary to account for. For example, we don't need modern physics (relativistic physics) to explain why an airplane flies or a ball falls. So, unless you are modelling something subatomic or travelling at >.1 the speed of light, Newtonian mechanics work fine. The issue is not mass, but air resistance when something falls. Otherwise, the hammer and the feather would fall at the same rate. It can be demonstrated over and over again in a vaccum chamber, or as we saw in the moon landings - assuming you are not one of those people that think we faked it. In a game, it just needs to be fun. Not physically perfect. My two cents.
-
Thanks for the responses guys. I'll let you know if I have any luck after work. Also, I am a recent upgrade owner to 2.3. My profile just isn't updated yet.
-
I can get the oil drums to fall using the new physics file. However, I can't seem to create a physics file on my own that will work in the same tutorial. I tried creating a simple box in 3dsmax v9. The gmf file is fine and looks fine in the scene. The phy file is created as well. The exporter seems to create the .phy file, but it doesn't fall in the same scene. Is anybody else having trouble creating physics files? Thanks