C# :: API That Convert 2D Cross Sections Into 3D Shape

Mar 1, 2014

I have cross sections in the form of rectangles in the XY plane formed from two point (top left, bottom right) as well as their Z position. I'd like finding some sort of API that can extrude a basic linear-average-approximated 3D shape (preferably eventually into STL format) from these points. I've tried googling but to no avail. The aim is to build a 3D shape from 2D wireframes.

View 2 Replies


ADVERTISEMENT

C :: Identifying Conic Sections?

Oct 6, 2013

I just finished a program on how to Identify any kinds of conic sections like circle,hyperbola, parabola and ellipse.

I dont about the other codes, they work but I think they are wrong.

I need to finish so that I can proceed to another program, I need to find what is the wrong in this equation, I dont know why the answer for eccentricity and others are different If I solved it manually.

View 10 Replies View Related

C :: Split Array Into Sections Of 2 Values

Mar 16, 2013

i want to split the array into sections of 2 values, recursively. the objective its to do the average.i have this input and output, that its correct:

> media_recursiva a 1 a 2 a 4 a 5 a 2 a 3 a 5 a 6
1.000
1.500
3.000
3.500

("a 1" means add the value 1)

but mine its wrong, it gives to me this:

1.000
1.000
2.500
3.000

Code:

float media(int arr[], int count) {
while(count != 0){
if(count==1)
return arr[0];
else if(count ==2){
return ((arr[0] + arr[1])/2);

[Code]....

View 5 Replies View Related

C++ :: Output Sections Of Txt Code In Random Order

Mar 27, 2014

I will keep this simple as I have the code written for my testing software program, I just want to add a feature of randomly generating the answer choice output order, I do not want to randomly output the full questions, but instead the choices (answers to the question), for example =

#include <string>
#include <iostream>
#include <limits>
cout <<" " << endl ; \ space

[Code] ....

As you can see I would like to output the answers, choices randomly as in answer choice 3 will appear at the top instead of 1. and so on, it doesn't matter if the numbers move with the txt as the numbers beside the
questions are txt.

It's a 32bit console application.

View 4 Replies View Related

C++ :: How To Get The Cross Product

Oct 10, 2014

I am trying to compute the cross product of an 1x6 column vector "D" with a 6xN matrix "S".

vector< vector<float> > D(1, vector<float>(6));
vector< vector<float> > S(6, vector<float>(10)); // Example where N = 10
float cProduct = D*S; // ?

The last line fails, so I'm wondering how you would get the cross product?

View 2 Replies View Related

C :: Best Process For Cross Compiling Application

Oct 26, 2013

I'm creating a small command line game in C. I have never done anything cross platforms, but this is small enough (so far) that it might not be too bad.

When I am done, I'm not sure how it will be distributed: Either I will just send people the C files and say "compile on your system with these options", or I will just have executables for various systems. Probably Windows 7/8, Ubuntu, CentOS, and whatever I can find to test on.

I right now I'm testing/developing on Windows 7 using MinGW. So my questions are: while I'm developing, how should I be compiling/testing it?

View 4 Replies View Related

C++ :: Write Cross-platform File IO

Aug 21, 2013

I discussed a topic about how to write cross-platform file IO code with a member named Disch for about a year ago. Since I am a beginner I am not sure if the "rules" for doing this has changed or not within C++.

He taught me that differenct CPU:s use different endianness when reading and writing to files. However, why can't the C++ standard file IO functions detect what endianness should be used on the current machine that is running the program? Why didn't the developers who created the standard library develop file IO functions that are cross-platform from the beginning? Have the rules changed since last year?

What I learn is that if you need to store data in files that will be read and written to on different machines, you have to define in the program what endianness should be used. For example, if I needed to store 4 bytes, I had to do this manually with my own functions and define in those which endianness is used.

View 3 Replies View Related

C++ :: Cross Platform Way To Execute A Program?

Apr 18, 2014

System();is bad, I get that. Is there another way, that works across platforms I can use to execute an external program. If not, is there a windows specific way.

View 2 Replies View Related

Visual C++ :: Cross Platform GUI Development

Aug 28, 2013

I am planning to develop a GUI that will run on Windows, Linux, Android & iOS. If am right, VC++ apps don't work on Linux, Android & iOS. Is that correct?

Is there an alternative to that? Which other tool works for GUI development on above mentioned 4 platforms?

View 2 Replies View Related

C :: Boolean Value Cross-functional In Game TicTacToe

Dec 11, 2014

Why something doesn't work without setting global variables. I want to know how to deliver values for example my boolean value "ende" (means end) from the function in line 99

Code:
bool pruefeGewinn() or in line 116 Code: bool spielfeldVoll() to the main function for using it there for Code: } while (ende != true); in line 164.

How to return it correctly?

Here is the Code of the game TicTacToe.

Code:
#include <stdio.h> // In- and Output
#include <stdlib.h> // Implementation of many functions
#include <stdbool.h> // Allows in C99 True and False as Boolean
#include <time.h> // Allows using Random by time

/*----------------------- Constants -------------------------*/

#define KANTENLAENGE 3
#define STRING 100

[Code] .....

View 6 Replies View Related

C++ :: Compute Area Of A Triangle Using Cross Product

Jan 8, 2015

I have to write some cpp program which computes area of a triangle using cross product,we give 3 vertices as R2 and 3 edges as double.

I am beginning like this;

#include <iostream>
#include "R2.h"
#include <cmath>
using namespace std;
double area ( R2 *A,double *z)

[Code] .....

View 5 Replies View Related

C++ :: Cross Platform Library For Simple Dialogues

Oct 17, 2013

In my game, I want to display dialogues for exceptions, and I don't really want to use something heavy like Qt, but then I also don't want to write and maintain my own platform-specific code to do it. Is there any library that can display simple message dialogues, just a few lines of text and an OK button, without being complete overkill like a full-blown GUI library?

View 13 Replies View Related

C++ :: Checking Dynamic Memory Cross-platform?

Feb 10, 2014

Suppose:

cin >> number;
pointer = new type[number + (rand()%number);

So, I wont know the memory allocated for pointer. How can I check it in all OS?

View 4 Replies View Related

C/C++ :: How To Cross Compile A GTKmm (Hello World) Program

Jun 20, 2014

I'm using ubuntu 14.04 and I want to cross compile this simple GTKmm program for Windows:

#include <gtkmm.h>
int main(int argc, char *argv[])
{
Glib::RefPtr<Gtk::Application> app =
Gtk::Application::create(argc, argv,
"org.gtkmm.examples.base");
Gtk::ApplicationWindow window;
return app->run(window);
}

I don't know how to do this...When I use this command:

x86_64-w64-mingw32-g++ main.cpp -o hello.exe `x86_64-w64-mingw32-pkg-config gtkmm-3.0 --cflags --libs`

I get this error:

In file included from /usr/include/cairomm-1.0/cairomm/fontoptions.h:26:0,
from /usr/include/cairomm-1.0/cairomm/surface.h:37,
from /usr/include/gdkmm-3.0/gdkmm/pixbuf.h:40,
from /usr/include/gdkmm-3.0/gdkmm/dragcontext.h:31,
from /usr/include/gtkmm-3.0/gtkmm.h:90,
from main.cpp:1:
/usr/include/cairo/cairo-ft.h:50:35: fatal error: fontconfig/fontconfig.h: No such file or directory
#include <fontconfig/fontconfig.h>

[code]....

View 10 Replies View Related

C++ :: How To Make (compiled) Code That Other Programmers Can Use (cross-platform)

Mar 29, 2013

(C++ question) I need to be able make a compiled code (like a .dll?) which other programmers can use on linux, win,, mac, etc.

The compiled code would simply do calculations and spit out an answer in memory.

I need it to have certain functions that they can easily call and understand (without actually seeing the source).

View 2 Replies View Related

C++ :: Turn Based Game - How To Make It Cross Platform

Sep 12, 2014

I am starting a turn based battle (similar to pokemon) app. How could i make this and make it cross platform. Also is it possible to make it access gps and allow other devices with the same app communicate with each other?

I have done things on the command line but i never made anything with images so i dont even know where to start for this app.

View 4 Replies View Related

Visual C++ :: Cross Platform Program - Make A Note Of Value Of PA

Nov 4, 2013

I'm working on a project which uses gtk+ and gtkmm. We use them in preference to MFC because the program needs to be cross-platform. For quite a long time, customers on OS-X and Linux have sometimes complained that the program would crash during shutdown but the Windows version (which I work on) never seemed to suffer. However, I'm now transferring my build environment to a new PC and I'm noticing the same shutdown crashes. It's a bit complicated so let me start with a small example:-

Code:
namespace Whatever {
class B {
public:
virtual ~B();
private:
int bb;

[Code] ....

Suppose I run the above program. When it stops at breakpoint #1 I make a note of the value of pA. Eventually the program reaches breakpoints #2 and #3. At each point my this pointer is exactly the same number. If the value of pA was 0x03604fb0, my this pointer is identical at both stages.

Now let's consider the real example:-

Code:
namespace Gtk {
class Widget {
public:
virtual ~Widget() {}

[Code] .....

Suppose I run the real example. At breakpoint #1 the value of pW is 0x03604fb0. But by the time I reach breakpoint #2 my this point is slightly different:- 0x03604fcc. It doesn't seem right to me and I'm wondering if it might be contributing to our shutdown crashes.

View 6 Replies View Related

C :: How To Print Another Shape Near Previous One

Nov 9, 2014

How do i print another shape near the one i did. I have this code but how i can put another shape near it like this

Code:
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 5; i++)
switch (i) {
case 0:
printf(" *

[Code] .....

View 7 Replies View Related

C# :: Custom Button Shape (WPF)

Nov 30, 2014

I have begun switching from WinForms to WPF and I'm having a hard time understanding the new concepts. In WinForms, I had a few User Controls, custom drawn using shapes (rectangles, ellipses, etc). They had some unique properties, like "Flashing" (setting this property to True and setting the "Flash Interval" property to 500 would have resulted in the control changing its background color to white and back again, every 0.5 seconds), "Beeping", etc.

I have tried to replicate these controls in WPF/XAML and so far managed to draw the shape. However, when it came to implementing a custom property that would redraw the background color of the rectangle every interval set by user in another property, i got stuck. The property is being set, but it doesn't change the background color. Alternatively, i have tried this method, with the same results (i got it to show in the "Properties" window in Visual Studio, i can set it, it is being stored in XAML, but it doesn't affect the background.

C# code behind:
public struct LCARSColors
{
public static Brush DarkBlue = (Brush)(new BrushConverter().ConvertFrom("#FF3366CC"));
public static Brush LightBlue = (Brush)(new BrushConverter().ConvertFrom("#FF99CCFF"));
public static Brush Pink = (Brush)(new BrushConverter().ConvertFrom("#FFCC99CC"));

[Code] ....

If i use this line (commented in this code sample):

<!--<SolidColorBrush x:Name="MySolidColorBrush" Color="{DynamicResource DarkBlue}" />-->

The background is colored in DarkBlue (as defined). But if i use this line:

<SolidColorBrush x:Name="MySolidColorBrush" Color="{Binding BackgroundColor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />

Nothing happens, the rectangle disappears entirely. If i add this to the above line:

FallbackValue=LightYellow

The rectangle is colored in LightYellow, meaning that the property is not accepted and the fallback value is used. Why?

View 9 Replies View Related

Visual C++ :: How To Determine Cross Platform Type During File Save

Nov 10, 2014

I am overriding OnSaveDocument in my MFC document class to strip out the carriage returns when saving my app's document to a UNIX file system but not when the user is saving a file to a Windows file system.

Is there a way to determine if the lpszPathName in OnSaveDocument(LPCTSTR lpszPathName) is a UNIX or Windows file system?

Note, I want to avoid hard coding server names and I want to avoid overriding the FileSave dialog and forcing the user to select Windows or UNIX.

View 6 Replies View Related

C :: Drawing A Shape (Square) Into PGM Image

Nov 22, 2013

I'm doing a project and I need to draw a square into a pgm image if certain conditions are met, but I'm not sure how to draw the square into the image.

View 2 Replies View Related

C++ :: Generic Shape Area Calculator

Dec 6, 2013

I'm building a pretty basic calculator program that calculates the area of generic shapes (triangles, rectangles, and squares); for some reason though, my program is having troubles as soon as it hits the if/else code in the int main section. When I enter triangle, rectangle, or square, it just spits back out the "That's not one of the options. Please re-enter and try again." error line I created. When I isolate and run just the stuff inside the if/else statements it works great, but why it won't just understand my if (shape == triangle).... .

Code:

#include <iostream>
using namespace std;
class figure {
protected:
double x, y;

[Code] ....

View 2 Replies View Related

C++ :: How To Make A Shape Outside Of Main Function

Sep 8, 2014

I know how to define a shape and attach it to a window as follows:

#include <Simple_window.h>
void cir() { Circle c(Point(100,100),50); }
int main() {
Simple_window win(Point(100,100),600,400, "test");

Rectangle r(Point(100,100),Point(300,200));
win.attach(r);
win.wait_for_botton();
}

But how to define a shape (say a circle by that cir() function which is) outside of the main() function? And how to attach it to be visible on window win?

View 4 Replies View Related

C++ :: Use Construct Object (Shape) Efficiently?

Jun 27, 2014

have a problem with my code (I wish for answer with code). The conditions I have to grant:

- **Only** a pointer to an object must be saved in a **standard** class vector (e.g vector<ShapePtr>)
- Base class must be a polymorphic class (I call this class ShapePtr)
- I **must** have a deep copy process
- Constructor is **not** suppose to do a deep copy
- **clone()** is suppose to do the deep copy

Here is the code **provided** to me:

main.cpp
int main() {
typedef shared_ptr<Shape> ShapePtr;
vector<ShapePtr> shapevec;

[Code].....

View 1 Replies View Related

C/C++ :: Count The Times A Shape Was Selected?

Jul 28, 2014

This is part of the program, What should i do if i want to total the number of times a shape was selected at the end?

#include<iostream>
#include<string>
#include<iomanip>

[Code]....

View 3 Replies View Related

C/C++ :: How To Make A Shape Outside Of Main Function

Sep 8, 2014

I know how to define a shape (here, a rectangle) and attach it to a window in C++ as follows:

#include <Simple_window.h>
void cir() { Circle c(Point(100,100),50); }
int main() {
Simple_window win(Point(100,100),600,400, "test");
Rectangle r(Point(100,100),Point(300,200));
win.attach(r);
win.wait_for_botton();
}

But how to define a shape (say a circle by that cir() function which is) outside of the main() function? And how to attach it on the window win to be visible?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved