|
I want format supported by XNA (.fbx)
But I can convert 3D Studio (.3ds) , DirectX (.x) file using blender to .fbx
|
|
|
|
|
a design that is simple but can make others shock when they see it..
anyone.. pls help me..
|
|
|
|
|
Black font on black background - shockingly simple.
Or what about mintgreen font on pink background, frame and title bar in all rainbow colours... nausea guaranteed.
|
|
|
|
|
Hey everyone, do you know particle deposition?it is an algorithm used to create 3D models. By any chance,does anyone here knew bout this algorithm?thanks 
|
|
|
|
|
hello friends,
how can i make a simple, soft and nice brush like that is in the microsoft paint?
My solution was to draw consecutive circles in my mouse drag event and add them to the array list and then repaint all circles in the array list. but some of the events of mouse drag are missed and this make my brush dotted. i want to know how can i make it more smooth. please guide me.
thanks
|
|
|
|
|
You can use a pen instead. First adjust the width of your pen. Then set StartCap and EndCap of the pen to LineCap.Round. Finally draw lines, instead of 'points', from the previous point to the current point, in the mouse move event.
|
|
|
|
|
|
The best way to handle this situation is to use an interpolation function to create a curve that smoothly joins the input points of the mouse.
The easiest pseudo sample is below, but you can expand it to use bicubic or any spline function.
void DrawPoint( double x, double y )
{
...paint single brush dab.
}
void DrawLine( double x0, double y0, double x1, double y1, double spacing )
{
double dx = x1-x0;
double dy = y1-y0;
double dist = sqrt( dx * dx + dy * dy );
dx *= 1.0 / dist;
dy *= 1.0 / dist;
for ( double p = spacing; p <= dist; p+= spacing ) {
double px = x0 + p * dx;
double py = y0 + p * dy;
DrawPoint( px, py );
}
}
void MyPaintCode( )
{
for ( int i = 0; i < NumberofPoints; i++ ) {
PaintLine( Input_x[ i ], Input_y[ i ], 1.0 );
}
}
|
|
|
|
|
Hey guys
So today a bought a webcam, now i want to capture the video, or rather for starters just display the feed on a panel.
Ive googled till im blue in the face(and will continue after posting this), i simply cant find a MINIMALISTIC article or tutorial on how to do this. From what I've read i need to use DirectShow...
Can someone please help?
Thanks
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
You can certainly use DirectShow although you've got to love COM to do it and the documentation sucks. If you're using XP, an alternative is OpenCV[^] which probably has the functionality you want built in. If you're using Vista, the capture parts of OpenCV are broken because they use VFW and that's not supported on Vista, although the camera display parts are ok since they're DirectShow based. There's a very active OpenCV group on Yahoo, if you get interested.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
Google for "Windows Image Acquisition webcam".
|
|
|
|
|
Advertising is expressly forbidden in the forums. Buy advertising space like everyone else. That alone will make you far more legitimate than stealing free space in a forum.
|
|
|
|
|
Hi,
I am writing an aplication where I would like to use the method of picking the object using their id color.
I use the glReadPixels function to read the color under the cursor, but it always send back the null values. I don´t know what I am doing wrong.
Here is my sample code:
picking(int x, int y)
{
glDisable(GL_DITHER);
glDisable(GL_LIGHTING);
glClearColor(0,0,1,0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
/* drawing */
glColorub(50,50,50);
glutSolidSphere(0.7, 20, 20);
glPushMatrix();
glPushName(1);
glColor3ub(255,0,0);
glRotatef(90,0,1,0);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();
glPopMatrix();
glPushMatrix ();
glPushName(2);
glColor3ub(0,255,0);
glRotatef(-90,1,0,0);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();
glPopMatrix();
glColor3ub(0,0,255);
glPushName(3);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();
glPopMatrix();
unsigned char pixel[3];
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);
glReadPixels(x,viewport[3]-y,1,1,GL_RGB, GL_UNSIGNED_BYTE,(void*)pixel);
/* just to see the result - always null */
byte a = pixel[0];
byte b = pixel[1];
byte c = pixel[2];
}
Thank you in advance for your help, Tomas
|
|
|
|
|
Have you checked glError after your call to glReadPixels? Probably won't tell you much, but just wondering.
Sounds like the x, y are out of bounds.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I am digging deep here: 999 times out of a thousand I can eventually find the information I need without posting on forum(s) [looks like I must be upto the thousand tolerance level ]
"Since a single mouse position has only two degrees of freedom, a pair of positions—the ends of an arc—are used.This part of Arcball has wider applicability, including a translation controller to be described in a future paper." "ARCBALL: a user interface for specifying three-dimensional orientation using a mouse",Ken Shoemake,September 1992,Proceedings of the conference on Graphics interface '92
1992, 16 long years ago.This is about the mysterious 'translation controller to be described in a future paper'. Does anybody know if that future paper materialised over the last 16 years? The last cited Shoemake paper I could find was: "Arcball rotation control",Ken Shoemake, August 1994 Graphics gems IV. And most of his other papers seem to diverge into the discipline of animation.
My conclusion so far is that Shoemake never got around to doing that 'translation controller' paper, or my understanding of that term is different to what he meant.
OR
Does anyone know of published works/papers by other authors that continued in Shoemake's footsteps towards describing a translation controller. Just to clarify: A brief description of my understanding of 'translation controller' can be found in my post(s) here
modified on Tuesday, September 16, 2008 10:56 AM
|
|
|
|
|
|
This[^] looks like it might cover what you're looking for. However, the link to the code no longer works. I seem to remember that when I was playing seriously with OpenGL, Mark Kilgard had some examples that used Arcball and the arrow keys to let you zoom, pan, etc, as well as rotate the object. I think there was something I didn't like about the implementation and changed it to better match my intuition.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
Thanks for that Tim. But I have already found that. It seems to actually talk about extending/handling the camera's 6 DOF of movement in relation to something like an Arcball implementation.
Where a 'Virtual Trackball/Arcball is used to rotate objects in 3D space", I am looking for an extension of the concept so that something like "Virtual Plane(s) are used to translate objects in 3D space" [bit like what is in the link to my other post(s)].
|
|
|
|
|
I am now thinking my understanding of the term "translation controller" is not what Shoemake meant when he wrote it. Anyone agree?
All I will have is conjecture.
And I don't think I will ever really find evidence to confirm exactly what Shoemake meant in that statement without actually asking him.
modified on Sunday, September 14, 2008 9:19 PM
|
|
|
|
|
hi all,
I m a student, currently having problem on how i can start programming.
my project require the use of an measurement device and it measurement are taken from the usb port and save in notepad .txt format, i am suppose to come out with an real time graphical display of the measurement, but i have no idea how i could start on it as i am new in programming. any help or suggest would be greater appreciated. Thanks
|
|
|
|
|
You say you're new to programming. How new? This isn't exactly a first project. What language do you plan to use? Unless you're actively monitoring the Notepad file as the data comes in, the data display wouldn't be considered "realtime". And if you're going to go to that much trouble, why not read the data from the instrument directly. If you need a text file, then write it from your program. Using Notepad this way is kind of hokey.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
hi,
this is exactly my first program, i will be using C#. The device i am using is a usb connected PC digital TV receiver this receiver software actually have a function which measure the signal strength, BER and these data are save into an log file (thus it real time measurement data) once i start the device (start watch TV).
I am suppose to use C# to get the real time measurement and convert it into graphic (line chart).
I have try to get the data for the log file and display it in the textbox using the following code
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Testing_1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader objstream = new StreamReader("c:\\measurement.log");
textBox1.Text = objstream.ReadToEnd();
}
but this is the error i got : the file been use by another program.
I also try another method which is directly from the usb port which the device is connected to but i am unable to start working on it coding. i had been looking into example of usb_hib and ICSHARPUSBlib but i was unable to get anything out.
Thus please help me, if i am in the right direction (get the data from usb directly?) or do you have any better item on how i should get this done, any code to refer to.
thank so much
|
|
|
|
|
You have my sympathy. If this is your first program, I'd suggest your teacher is a sadist, or just grossly imcompetent.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
Hi
The following code produces a screen capture of the whole desktop to a .bmp file. It works fine when you have 16-bit color depth set at Windows display properties, but when you use it with 32-bit color depth, the image produced is crooked and disorted in a very strange way. I have tried absolutely everything to figure out what causes this, but nothing seems to work.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <fstream>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HWND hWnd = GetDesktopWindow();
HDC hDc = GetDC(hWnd);
WINDOWINFO window_info;
window_info.cbSize = sizeof(WINDOWINFO);
GetWindowInfo(hWnd, &window_info);
const unsigned width = window_info.rcClient.right - window_info.rcClient.left;
const unsigned height = window_info.rcClient.bottom - window_info.rcClient.top;
const unsigned size = ((width * 24 + 31) & ~31) / 8 * height;
PSTR pixels = NULL;
BITMAPINFO bitmap_info = {0};
bitmap_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bitmap_info.bmiHeader.biWidth = width;
bitmap_info.bmiHeader.biHeight = height;
bitmap_info.bmiHeader.biPlanes = 1;
bitmap_info.bmiHeader.biBitCount = 24;
bitmap_info.bmiHeader.biCompression = BI_RGB;
bitmap_info.bmiHeader.biSizeImage = size;
HDC hCompatibleDc = CreateCompatibleDC(hDc);
HBITMAP hBitmap = CreateDIBSection(NULL, &bitmap_info, DIB_RGB_COLORS, (void **)&pixels, NULL, 0);
SelectObject(hCompatibleDc, hBitmap);
BitBlt(hCompatibleDc, 0, 0, width, height, hDc, window_info.rcClient.left, window_info.rcClient.top, SRCCOPY);
BITMAPFILEHEADER file_header = {0};
file_header.bfType = 0x4d42;
file_header.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + size;
file_header.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
std::ofstream image("image.bmp");
image.write((PSTR)&file_header, sizeof(BITMAPFILEHEADER));
image.write((PSTR)&bitmap_info.bmiHeader, sizeof(BITMAPINFOHEADER));
image.write(pixels, size);
image.close();
SelectObject(hCompatibleDc, NULL);
DeleteObject(hBitmap);
DeleteDC(hCompatibleDc);
ReleaseDC(hWnd, hDc);
return 0;
}</fstream></windows.h>
Does anyone have any clue to why this doesn't work? I've also tried to create a DC using the CreateDC function with TEXT("DISPLAY") and NULL parameters to create a device context that spans all display areas, but that produces the same error in the image using 32-bit color depth.
|
|
|
|
|
rikshot wrote: std::ofstream image("image.bmp");
Ouch Text streams will really screw up image data.
Try binary...
std::ofstream image("image.bmp", ios_base::out | ios_base::binary);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|