[QUOTE=Map in a box;31043553]I thought about that, but that would mean a new object for every particle. I didn't know how I would do physics, and render, thats 4 for loops for every particle.[/QUOTE]
you would only need 2 for loops, one to step the physics world, then another to render everything in it's current state... unless I'm doing my math wrong or something
[editline]11th July 2011[/editline]
[QUOTE=Chris220;31043870]Ah, that worked, thanks!
So, since glEnableClientState() is deprecated (as is glVertexPointer and so on), I assume the next step is to get it running on shaders instead of OpenGL's own matrix manipulation; then using glVertexAttribPointer() and so on.
Thanks again :)[/QUOTE]
once you start using shaders and your own matrices, you'll have fully forward-compatible OpenGL code (assuming you update all your code)
[QUOTE=robmaister12;31045287]you would only need 2 for loops, one to step the physics world, then another to render everything in it's current state... unless I'm doing my math wrong or something
[editline]11th July 2011[/editline]
once you start using shaders and your own matrices, you'll have fully forward-compatible OpenGL code (assuming you update all your code)[/QUOTE]
I'm just writing a properly error-checked shader compiler/linker class to make it all a lot easier to load a vertex and fragment shader from a couple of files, then link them together and so on.
After that, it's time to wrestle with matrices; something I'm not very good at :v:
-snip-
I've got a serious problem with exporting my projects to runnable .jar files. No matter how much time I spend making sure the manifest and classpaths are correct, I always get an error like this:
[img]http://i.imgur.com/wUReE.png[/img]
Manifest:
[code]Manifest-Version: 1.0
Rsrc-Class-Path: ./ lwjgl.jar slick.jar
Class-Path: .
Rsrc-Main-Class: system.Main
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
[/code]
The contents of my .jar:
[img]http://i.imgur.com/vCUub.png[/img]
Please help! I'm so close to releasing my first complete program I can almost taste the victory. :v:
I think you're running it wrong. On Linux at least, you need to run java -jar jarfile.jar
[QUOTE=thelinx;31049439]I think you're running it wrong. On Linux at least, you need to run java -jar jarfile.jar[/QUOTE]
Hang on, you're absolutely right.
[img]http://i.imgur.com/rYSZ5.png[/img]
My classpath must be set up wrong. Any idea how to fix it?
[editline]11th July 2011[/editline]
Son of a bitch, I can make it work if I add this every time I run it on the command line:
java -Djava.library.path=C:\users\nige\workspace\defendo\lib -jar defendo.jar
But it still won't work by double-clicking on the .jar. How can I fix this?
[QUOTE=Murkrow;31044425][URL]http://www.dotnetspider.com/resources/4579-Start-process-wait-until-exits.aspx[/URL][/QUOTE]
I already know how to do that. The problem is that the exe I'm launching isn't the one that's running the game.
How would i prompt the user before closing my sfml window?
I've tried this:
[cpp]
#include <windows.h>
// ...
if (ev.Type == Event::Closed)
{
// Close the window
HRESULT result = MessageBoxW(NULL, L"Are you sure you want to quit?", L"AAP", MB_ICONQUESTION | MB_YESNO); // BUT WAIT!
if (result = IDYES)
window.Close(); // Now close it
else
window.Show(true);
}
[/cpp]
Ain't working.
[QUOTE=vexx21322;31051622]I already know how to do that. The problem is that the exe I'm launching isn't the one that's running the game.[/QUOTE]
Use the thing I forgot the name of to convert your jar to an exe, if I remember ill tell you. Also eclipse has a rightclick-export function.
Here is a puzzle for you guys:
If this->velocity.getX() and this->velocity.getY() return 0(zero) how can the new position of the sprite be set to[-2147483648,-2147483648] ?
I have a feeling I have a virus that makes my game do sh*t so I get frustrated. This is just ridiculous.
[code]void Sprite::move()
{
if (this->movement_type==MOVE_AUTO)
{
this->setX(this->getX() + (this->velocity.getX())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
this->setY(this->getY() + (this->velocity.getY())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
}
}[/code]
If I remove g_engine->game_speed*((double)64/g_engine->getFrameRate_real()) I get right result, but isn't 0*some number=0 ???
[QUOTE=AntonioR;31054156]Here is a puzzle for you guys:
If this->velocity.getX() and this->velocity.getY() return 0(zero) how can the new position of the sprite be set to[-2147483648,-2147483648] ?
I have a feeling I have a virus that makes my game do sh*t so I get frustrated. This is just ridiculous.
[code]void Sprite::move()
{
if (this->movement_type==MOVE_AUTO)
{
this->setX(this->getX() + (this->velocity.getX())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
this->setY(this->getY() + (this->velocity.getY())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
}
}[/code]
If I remove g_engine->game_speed*((double)64/g_engine->getFrameRate_real()) I get right result, but isn't 0*some number=0 ???[/QUOTE]
Try rapping it around more parens
[QUOTE=AntonioR;31054156]Here is a puzzle for you guys:
If this->velocity.getX() and this->velocity.getY() return 0(zero) how can the new position of the sprite be set to[-2147483648,-2147483648] ?
I have a feeling I have a virus that makes my game do sh*t so I get frustrated. This is just ridiculous.
[code]void Sprite::move()
{
if (this->movement_type==MOVE_AUTO)
{
this->setX(this->getX() + (this->velocity.getX())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
this->setY(this->getY() + (this->velocity.getY())*g_engine->game_speed*((double)64/g_engine->getFrameRate_real()));
}
}[/code]
If I remove g_engine->game_speed*((double)64/g_engine->getFrameRate_real()) I get right result, but isn't 0*some number=0 ???[/QUOTE]
You either have an overflow, or more likely, an uninitialised variable somewhere. Check everything in that equation and make sure it has a proper value.
So, I wrote my shader compiler class, made some basic shaders. Both are getting this error:
[code]Failed to compile shader: GL_VERTEX_SHADER
Compile log:
(0) : error C0000: syntax error, unexpected $end at token "<EOF>"
(0) : error C0501: type name expected at token "<null atom>"[/code]
No matter what I put in the shader... I'm really, really confused. Any ideas?
DIVISION BY ZERO !!!!!!!!!!!!!!!!!!
For two days I try to fix this and it was division by zero. The problem was only in the first frame of the program, g_engine->getFrameRate_real() would return 0 (some counter inside was initalised at 0) so 64/0 messed everything up.
NOTE: THIS IS NOT PART OF THE ENGINE I WROTE !
Well, this is bugging me. Used to, in like VS08, intellisense worked. Now when I try to include a library like glua or sfml, "NO ADDITIONAL INFORMATION AVAILABLE(just to make u mad trolol)" makes me mad :( I'm trying to lrn2c++
[editline]11th July 2011[/editline]
[QUOTE=Woodcutter11;31052613]How would i prompt the user before closing my sfml window?
I've tried this:
[cpp]
#include <windows.h>
// ...
if (ev.Type == Event::Closed)
{
// Close the window
HRESULT result = MessageBoxW(NULL, L"Are you sure you want to quit?", L"AAP", MB_ICONQUESTION | MB_YESNO); // BUT WAIT!
if (result = IDYES)
window.Close(); // Now close it
else
window.Show(true);
}
[/cpp]
Ain't working.[/QUOTE]
Based on what I found out in the past 10 seconds,
If the result is yes, just break out of the while loop, or (running=false in the examples) else just dont do anything
[editline]11th July 2011[/editline]
Also use == not =
[editline]11th July 2011[/editline]
[code]
if (Event.Type == sf::Event::Closed){
HRESULT result = MessageBoxW(NULL, L"Are you sure you want to quit?", L"AAP", MB_ICONQUESTION | MB_YESNO); // BUT WAIT!
if (result == IDYES)
Running=false;
}
}
[/code]
im making a console class in my XNA gaem but I cant get the text to draw D:
Just wondering if anyone else can see the problem.
-FIXED- Damn < and > confused
The console area displays fine (A white box/area) which is the render target.
But the text which should display doesnt.
I have tried changing the positioning, the font file, the colours...
Working on making my first program using models in XNA, and I seem to have run into a roadblock. I'm following a great book that tells you what to do instead of showing you the code block, and you learn a LOT more from it. The only problem is that it makes finding issues hard as hell. I tried for awhile to find what's wrong with this, and I just can't. Can anyone tell me what's wrong? This is my model declaration class.
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Cube
{
class Basicmodel
{
List<Basicmodel> models = new List<Basicmodel>( );
public Model model { get; protected set; }
protected Matrix world = Matrix.Identity;
public BasicModel(Model m)
{
model = m;
}
protected override void LoadCotent( )
{
models.Add(new BasicModel(
Game.Content.Load<Model>(@"models\gun")));
base.LoadContent( );
}
public virtual void update ( )
{
}
public override Draw(GameTime gameTime)
{
base.Draw(gameTime);
}
public void Draw(Camera camera)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect be in mesh.Effects)
{
be.EnableDefaultLighting( );
be.Projection = camera.projection;
be.View = camera.view;
be.World = GetWorld( ) * mesh.ParentBone.Transform;
}
mesh.Draw( );
}
}
public virtual Matrix Getworld( )
{
return world;
}
}
}
[/code]
[QUOTE=Mr. Smartass;31056044]Working on making my first program using models in XNA, and I seem to have run into a roadblock. I'm following a great book that tells you what to do instead of showing you the code block, and you learn a LOT more from it. The only problem is that it makes finding issues hard as hell. I tried for awhile to find what's wrong with this, and I just can't. Can anyone tell me what's wrong? This is my model declaration class.
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Cube
{
class Basicmodel
{
List<Basicmodel> models = new List<Basicmodel>( );
public Model model { get; protected set; }
protected Matrix world = Matrix.Identity;
public BasicModel(Model m)
{
model = m;
}
protected override void LoadCotent( )
{
models.Add(new BasicModel(
Game.Content.Load<Model>(@"models\gun")));
base.LoadContent( );
}
public virtual void update ( )
{
}
public override Draw(GameTime gameTime)
{
base.Draw(gameTime);
}
public void Draw(Camera camera)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect be in mesh.Effects)
{
be.EnableDefaultLighting( );
be.Projection = camera.projection;
be.View = camera.view;
be.World = GetWorld( ) * mesh.ParentBone.Transform;
}
mesh.Draw( );
}
}
public virtual Matrix Getworld( )
{
return world;
}
}
}
[/code][/QUOTE]
Your LoadContent method is [B]LoadCotent[/B]. When you load your model you are writing [B]models\gun[/B], it has to be [B]models\\gun[/B], or [B]models/gun[/B].
I don't know what your problem is though, so i was just checking for general errors.
[QUOTE=Dj-J3;31057830]Your LoadContent method is [B]LoadCotent[/B]. When you load your model you are writing [B]models\gun[/B], it has to be [B]models\\gun[/B], or [B]models/gun[/B].
I don't know what your problem is though, so i was just checking for general errors.[/QUOTE]
Sorry, I was an idiot for not posting the errors it threw at me. The errors are;
[code]Error 7 The name 'GetWorld' does not exist in the current context C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 58 32 Cube
[/code]
[code]
Error 1 Method must have a return type C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 22 16 Cube
[/code]
[code]
Error 2 Method must have a return type C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 41 25 Cube
[/code]
[code]
Error 4 An object reference is required for the non-static field, method, or property 'Microsoft.Xna.Framework.Game.Content.get' C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 30 17 Cube
[/code]
[code]
Error 5 'object' does not contain a definition for 'LoadContent' C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 32 18 Cube
[/code]
[code]
Error 6 'object' does not contain a definition for 'Draw' C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 43 18 Cube
[/code]
[code]
Error 3 'Cube.Basicmodel.BasicModel(Microsoft.Xna.Framework.Graphics.Model)' is a 'method' but is used like a 'type' C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 29 28 Cube
[/code]
[QUOTE=Mr. Smartass;31058237]Sorry, I was an idiot for not posting the errors it threw at me. The errors are;
[code]Error 7 The name 'GetWorld' does not exist in the current context C:\Users\Administrator\Documents\OpenTK\Cube\Cube\Cube\Basicmodel.cs 58 32 Cube
[/code][/QUOTE]
This says you're using GetWorld, but your method is Getworld, I think C# is case sensitive.
[QUOTE=Biotic;31060937]This says you're using GetWorld, but your method is Getworld, I think C# is case sensitive.[/QUOTE]
Over 90% of languages are.
Including English, plus, I don't think so, but, I think Korean is case sensitive, but it might actually be since their leader is so sensitive.
[QUOTE=Biotic;31060937]This says you're using GetWorld, but your method is Getworld, I think C# is case sensitive.[/QUOTE]
Thanks, that fixed one of the errors (stupid error on my part to be honest) But I can't seem to find the cause of the other ones.
I'm writing a Minecraft classic server. When you send chunk data, are you sending the file data or the raw data? So basically, do you send the gzipped file data, or the uncompressed block array?
[QUOTE=snergwerf;31061852]I'm writing a Minecraft classic server. When you send chunk data, are you sending the file data or the raw data? So basically, do you send the gzipped file data, or the uncompressed block array?[/QUOTE]
I believe the gzipped file data.
[editline]11th July 2011[/editline]
Just try it out, if it fails try other things.
So i made a program for a game that will monitor health/mana and level, and this are the virusscan results [url]http://virusscan.jotti.org/en/scanresult/fb43eb893a154a924553aaaae39f1e711ccd3b8f[/url]
It doesn have any virus.
Why does it do it ?
Did you used any public (dll injection)code ?
Yes, im using a module to read n write the memory
[QUOTE=cNova;31064529]Yes, im using a module to read n write the memory[/QUOTE]
That's why then, some virus scanners will pick that up as being malicious.
Im looking for a book to learn openGL, I wish it to start at the basics (window creation & displaying stuff on screen) and then go up to VBO, shaders and all the more advanced stuff.
My computers currently only support openGL up to 2.0 therefore I have no need for a brand new book.
I was however hoping that they would teach you pure openGL without the use of any 3rd party libraries i.e GLUT.
I was wondering if maybe the 3rd edition of the openGL superbible would do as you can get it pretty cheap on amazon.
Crossposting from waywo:
So I'm still working on this simple game of mine but I keep running into huge problems because of my lack of knowledge of matrices and basic 3d math. Does anybody know any books on the markets or perhaps some other way to get a basic understanding of the math involved in a 3d game?
[QUOTE=Capsup;31072292]Crossposting from waywo:
So I'm still working on this simple game of mine but I keep running into huge problems because of my lack of knowledge of matrices and basic 3d math. Does anybody know any books on the markets or perhaps some other way to get a basic understanding of the math involved in a 3d game?[/QUOTE]
I have this book [url]http://www.amazon.co.uk/Primer-Graphics-Development-Wordware-Library/dp/1556229119[/url] its pretty awesome, and you might find it cheap on ebay.
As for free resources then khan academy is probably your best place to look
Sorry, you need to Log In to post a reply to this thread.